2

Im not an expert in this field at all. Im trying to re-size batch images from the web and for the most part it is working great. I am running into images that are huge in size and re-sizing and compressing through mogrify just isnt working.

Ive used a standard desktop image re-sizer and it re-sizes the compresses the image to a reasonable size. The size is 500kb+ and they re-size it to 20kb. My mogrify cmd is leaving it just shy of 500kb.

Here is an example image http://c.shld.net/rpx/i/s/pi/mp/3962/225051167p?src=http%3A%2F%2Fwww.petraimages.com%2F500x500%2FTHRFBB1000P6.jpg&d=2ae05e1b6fd7950ae4fbbe2cc9039c0265073173

I am using the trim, resize (250x250), compress (JPEG), format (JPEG) cmd line args for mogrify. Ive tried playing around with the compression but no luck.

kgibbon
  • 726
  • 1
  • 15
  • 37

1 Answers1

2

Seems your example picture consists mostly of an ICC color profile. This can be removed by adding

+profile icc

to the commandline options of mogrify or convert, for example

convert example.jpg +profile icc example_out.jpg

reduces the file size to 28kb.

convert example.jpg +profile icc +profile xmp example_out.jpg

results in 12 kb (even without reduction of pixel size or colors).

Doc Brown
  • 19,739
  • 7
  • 52
  • 88
  • great! Thanks for the info. I want to remove all profiles but I am using graphics macgick which has image magic 5.5. I want to use the strip option but it is only in 6.0+. Ideas? – kgibbon Aug 29 '11 at 17:48
  • @kgibbon: having a short look into "http://www.graphicsmagick.org/GraphicsMagick.html#opti", I found the '+profile' option there, too. And don't forget to give me an upvote and accept my answer, if it helped you, please. – Doc Brown Aug 30 '11 at 06:51
  • done! Here is another one for ya. Why does this image crash gm all together? No errors or nothing. gm mogrify -size 250x250 -thumbnail 250x250 -format jpg -trim +profile "*" http://c.shld.net/rpx/i/s/pi/mp/3943/246733641p?src=http%3A%2F%2Fimages.builderdepot.com%2FBluworldInnovations%2Fprodimg%2FGF6BG-1.jpg&d=4bcbf7ea01a46fc593d12f528b368ed6d1e8fe21 – kgibbon Sep 09 '11 at 04:56
  • @kgibbon: don't know, ImageMagick 6.6.5 does not crash. You should try just one feature after another to work this out (or letting out some options, one after another). By the way, did you read the manual thoroughly? "-size" options seems to be pointless for picture formats like JPG (and perhaps the crash is caused by specifying a wrong size, like you did here). – Doc Brown Sep 09 '11 at 06:30