I have a 1x1 inch passport photo and I want to store it in a computer disk in a way I minimize the size but also been able to print it back to the real world.
What do you recommend me? Thanks in advance.
UPDATE: this question is about image resolution.
If you have a database, consider storing the image in a BLOB column, that will allow you to relate it with other information.
Related
in our website we are retrieving data from an API, which does not pull images bigger than 100 × 75 pixels, then we show them listed. example We need to double up this size to match with our design.
Is there any Gem that does this, without loosing quality and not impacting performance?
There is no way to upscale an image without losing quality - you're basically asking an algorithm to fill in image data that simply does not exist in the file in the first place.
However, depending on the rate of the scaling and the images themselves, you could have acceptable results.
Since you want to do this effectively and there is no benefit of doing the resizing on the server anyway, I'd advise simply using CSS to achieve this on the client side - just set the desired width/height attributes for the specific img elements.
If you really want to do this on the server (e.g. if you need to save the resulting images), one option would be to use the Paperclip gem's image processing capabilities.
My app has huge size of images, I wanted to reduce the size, I have achieved reducing the size by using webp format images. I followed this.but the sad part is, It is taking so much of time to load images as a result my app performance is vey slow.Could any one help how to fix this issue?
Thanks in advance.
I need to reduce the size of UIImage captured from Camera/Gallery & reduce to size to max 200kb.
The UIImage would then saved to a SQLite Database in the app.
I tried using UIImageJPEGRepresentation(image, compression); in while loop. but couldn't crack it.
Thanks for the help..!!!
You need to scale the image down first, straight out of camera it will likely be too big. Something like 1000 pixels on the longest side might be enough, but you can play with it and see what works for you. Then apply JPEG compression to a scaled image.
Also the way JPEG works, it's pointless to run the algorithm over and over again. Just pick a good compression rate and run it only once.
On a tangent, in many cases where you need to save a large data blob in a database, you might find it more memory efficient to save the data into a separate file in the file system, and store the path in the data base.
I'm capturing an image from the iPhone camera and storing it in the document folder for further check and use.
Before storing the image i want to check the image quality based on the RGB value, grayscale and white balance , etc.
All that i can get from the image. But i am not able to understand what should or how should i use any framework that would help me retrieve this information.
Any help would be appreciated.
Thank you!
This app may do what you want. It is called Photo Metadata Reader. I saw it had RGB in the screenshots.
https://itunes.apple.com/us/app/photo-metadata-reader/id437865801?mt=8
If you want to retrieve metadata from UIImage - check this
https://github.com/foundry/UIImageMetadata
If you want to get, for example, color balance, I think you must get pixel data from image and compute this by yourself
I'm using attachment_fu and RMagick to upload/resize images on a rails app. Currently I use the local file system as the storage but I have a plan to use AWS S3 for the job. Anyway I am quite interested to know what other peoples' experiences on using S3 and also I have a one big question for you. In my app when a user uploads an image I resize this image to 5 different sizes and store them along with the original images. (altogether 6 images) based on thumbnail sizes provied in the model:
:thumbnails => {
"thumb" => "120x80",
"extra_small"=>"480x320",
"small"=>"640x480",
"medium" => "800x533",
"large"=>"2738x1825",
"extra_large" => "3464x2309"
Finally I get:
image_foo.jpg (Original Image)
image_foo_thumb.jpg
image_foo_extra_small.jpg
image_foo_small.jpg
image_foo_medium.jpg
image_foo_large.jpg
image_foo_extra_large.jpg
The reason why I re-size these images is I need the actual sizes of each image to be stored in the database. But actually even I specified the sizes for thumbnails I don't get the exact sizes. Anyway its OK, as the size is calculated based on the aspect ratio.
But I really don't like to waste the space on the server if I can calculate the thumbnails sizes without saving them to the file system. In other words, I only need to store the original file not the thumbnails, but still I need to get the sizes of the thumbnails. Is it possible to get the actual thumbnail sizes without creating them in RMagick?
Space on S3 is relatively cheap. So I wouldn't worry too much.
However, you could consider converting the images to fewer sizes. You could leave small and extra-small out and use the width and height attributes of the HTML img tag. However, that will make your side load slower and cause more traffic.
I guess what you are really looking for is a solution that converts the files on the fly when they are requested right? I am not sure if there is a solution for that off the shelf. However, this would be a major performance suck.
So my recommendation is to just stick with all the different sizes and pay a few cent more to amazon. This will yield best performance and will be easiest to maintain. You don't have to worry about scaling and the fact that storage is getting cheaper and cheaper works for this solution.