Page 1 of 1

JPG Image Quality Loss - what do I do???

Posted: 2012-03-08T19:37:01-07:00
by longjk
I am new to IM and tryign to create a flop of an jpg, and concatenate the orginal and the flopped image back together. Script below:

convert %%a -flop %%a
convert %%a -flop b.jpg
montage %%a b.jpg -mode Concatenate -tile 2x %%a
del b.jpg

The script works, but I loss image quality on some of the jpgs (others work fine). Any ideas how to fix? PLEASE I need your help...

Thanks,

John

Re: JPG Image Quality Loss - what do I do???

Posted: 2012-03-08T19:53:30-07:00
by fmw42
JPG is a lossy compression. So use something like PNG for any intermediate step that you have to save.

but there is a simpler way (in windows syntax)

convert image.jpg ( -clone 0 -flop ) +append result.jpg

see parenthesis processing and clones and append at:
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#seq_combine
http://www.imagemagick.org/script/comma ... rn7#append

Re: JPG Image Quality Loss - what do I do???

Posted: 2012-03-08T21:30:55-07:00
by longjk
Thanks for the response. Do you happen know of anyway to accomplish this task in a batch process and keep the image quality? -Thanks so much...

Re: JPG Image Quality Loss - what do I do???

Posted: 2012-03-08T21:44:08-07:00
by fmw42
You could script a loop to process every image in some directory with the above command. This is the only way I know. I could script this in Unix/bash, but I am not a Windows user nor do I program DOS shell/Bat scripts.

The only suggestion again is to avoid saving too many times to jpg and to use -quality to control compression vs quality. Or use lossless jpg (JP2 format) or something such as GIF or PNG.

Re: JPG Image Quality Loss - what do I do???

Posted: 2012-03-08T21:47:32-07:00
by anthony
GIF is far from 'lossless' for non-cartoon-like images. Its saving grace is its ubiquitous availability and use for animations on web pages.

PNG is the way to go. MIFF for temporary intermediates, and MPC for extremely temporary saves.