Question

I tried to batch resize some jpeg images using imagemagick. I could change resolution of pictures but it's size not getting reduced. I also tried with sips command in mac. Result was the same.Any idea?

Edit

I usually re size and reduce size of lot of images.But I faced issue only for these images.It has resolution around 3000*3000.

After Resize the Dimension changed but size is still 560 KB.

Get info

Was it helpful?

Solution

You are probably getting more colors in your output file than in the input. If you want to preserve the orginal color set, use nearest-neighbor sampling instead of other types of filtering such as used by default when resizing. If you are using the command line, try

convert image_in -sample WxH image_out

instead of

convert image_in -resize WxH image_out

The result might be more jaggy than you'd like, so it's your choice to trade off appearance for filesize.

EDIT: The question was edited after this answer. The added information indicates that the image is in JPEG format (so adding colors is probably not the explanation) and it contains a SWOP color profile. The profile could be large, and is preserved by ImageMagick. For details, type "identify file.jpg", which will give you among other things the size of the color profile. If you want to remove the profile, use the "-strip" option.

OTHER TIPS

You need to tell use what the file types you are working with, what they contain, how large they are, and what settings you are using.

For example, if you have an indexed PNG (8-bits per pixel), some applications convert it to 24 or 32 bits per pixel. That can give you an increased file size.

You have the tag JPEG below. If its JPEG, the sampling settings or quantization settings for your output may be different from your input.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top