I can capture a still image on an iPad Retina Display with GPUImage using the crop filter (to 8x10 ratio with a size of 2420x1936 pixels = 4.68 megabytes) using capturePhotoAsPNGProcessedUpToFilter. The resulting PNG is 10mb, almost double the size of what an uncompressed image would be.
Is there a setting I am missing for PNG processing? Is there another way to reduce the size of the PNG file during capture?
A file this large really slows down things downstream.
Thanks for any advice or help!
Related
How can I convert a 256x256 JPEG to a 512x512 JPEG without losing any quality? (I can use jpegtran, but that uses SmartScale, which isn't widely supported.)
It must be converted to JPEG specifically. If it cannot be a literally lossless conversion, can it get very close? Virtually lossless? Thanks.
EDIT:
If it's not possible with any existing tool, please tell me if and how it might be possible in theory.
EDIT 2:
The reason I'm asking is because I want to losslessly combine 512x512 image tiles from the internet in order to re-assemble a panoramic image. The problem is that some of these tiles (along the top and bottom rows of the image) are 256x256 resolution, and require stretching before being combined with the other tiles. So in short, most of the tiles are 512x512 and thus wouldn't require reencoding, but some 256x256 tiles would.
If the 256x256 JPEGs became 512x512 JPEGs, I could combine all the tiles with jpegtran without reencoding, and they would form a simple equirectangular image.
I don't want to encode these panoramas to a different format like PNG, if I can help it, but I know I may need to. So I'm wondering if these few half-sized tiles can be scaled up essentially losslessly.
In particular, I'm using ImageMagick to draw a square over the jpeg, with a transparent fill and a pretty thin stroke?
My intuition says that the straight lines of the stroke might appear blurry, but that's less important than maintaining the quality and size of the original image.
Is there anything else that I should take into consideration?
Jpeg is lossy: compresses more but the quality decreases. You should try different levels of compression and comprare the results ( quality and size) against the png version. It may depend a lot on the contents of the image ( some images compress better than others)
When I convert png to jpeg , size of image is increasing for 2 percent cases. I am using convert command of imagemagick for this. Also able to handle alpha transparency factor by maintaing white background . But , I am not getting increase in size of image . It is very well known that pngs are lossless and jpegs are lossy , then what is the specific reason and what can be work around for it.
Please refer above mentioned example pic
Try decreasing JPEG quality setting. Jpeg uses Discreet Cosine Transform (DCT) to decrease the size of spatial data, but on high quality setting with high-detailed input images
you will get some size increase due to the fact, that data is not quantized enough and DCT-ed data needs some storage too.
i have a bunch of images which are way too big i need to decrease their size from 30 kb to 10 or 5 kb without loosing quality. I tried to change the dpi and pixels with no succeed. The images got blurred, and as they have text i can't read anything after the changes. Is there anyway i can accomplish this without loosing quality? I have almost a dozen images in my application.
Thanks in advance and have a nice day.
for batch resizing I use IrfanView (despite it's "lite-ness" it's very powerful).
It has a nice batch dialog, with a lot of options.
If you're working with png files try using better compression, and/or different color depth settings (if you're not using transparency you could try converting them to jpeg, although you might lose some quality)
changing color depth/range/compression might not affect image quality (not visibile anyway, if used with moderation) and it will decrease the size of the picture - in most of the cases anyway
if you want to stick to Gimp (I never personally used it), it should have some export features where you can select some settings for the image, like format and options
You cannot leave out data without reducing quality. Data has meaning.
You may try to use improved compression, pngcrush is the tool that automatically tries several approaches for you and picks the best.
Reducing colour depth will reduce the file size (while reducing colour quality). You can also turn on dithering in some image editors, but that's another loss in quality.
If your image has photographic content rather than graphical, convert to JPEG and use the JPEG quality settings, experiment with them a bit.
It seems that if I have a large png of 2500px wide and I want to resize it down to 100px wide, If I scale the image all at once the the desired size the image becomes way to distorted to use.
However If I scale the image in small increments of 200 pixels and repeat until you reach the desired length the image does not get as distorted. So if Im at 2500px then I would scale the image to 2300px then to 2100 and so on. The smaller the scale the less distortion.
Any resize method will have some loss, no matter how small. Following steps will make you lose quality.
steps for a single layer
layer->scale layer
image->scale image
image->fit canvas to layer
file->export as
steps for multiple layers
layer->new layer group
move all layers to layer group
select layer group
layer->scale layer
image->scale image
image->fit canvas to layer
file->export as
I have a 1000x1000 300dpi image that I need to convert to a 100x100 96dpi thumbnail. How do I do this in ImageMagick? I'm after the smallest possible file size at the highest possible quality.
Doing something like this:
convert myimage.png -quality 100 -resize 100 PNG8:mynewimage.png
.... does change the dimension, but still maintains the DPI. If I can get this to change to 96dpi, I should get a smaller file size.
I've tried -density, etc., but can't seem to make them work for me. Maybe I put the commands in the wrong order or passed the wrong parameters. Any assistance is greatly appreciated. Thanks.
The short version is, if you want a 100x100 image in PNG format, the line you have will already give you best quality at smallest file size. You can't do any better than that without a) coding to a lossy format (JPEG) or b) reducing the color depth of your image.
For a slightly longer explanation, straight from Wikipedia: "Dots per inch (DPI) is a measure of spatial printing or video dot density, in particular the number of individual dots that can be placed in a line within the span of 1 inch (2.54 cm). The DPI value tends to correlate with image resolution, but is related only indirectly."
DPI has nothing to do with getting a smaller file size; your 100x100 image measures 100x100 pixels, no matter whether you see it on a 300dpi screen or a 96dpi one (it will just look smaller on the 300dpi screen). The amount of information is the same either way.
"-density" won't help either, as it only works when "encoding a raster image while rendering (reading) vector formats such as Postscript, PDF, WMF, and SVG into a raster image". Those formats are resolution-independant, so it makes sense to tell ImageMagick the DPI to which you want the image rasterized. However, your DPI should be a function of the output device you plan to use. In your case, since you're starting with an already-rasterized image, this has no use.
PNG is a lossless format, so the -quality parameter only controls the zlib compression level; any gains in image size will be minimal, but it's worth using.