Thumbnail best resize suprise

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Albireo
Posts: 68
Joined: 2010-01-12T03:32:23-07:00
Authentication code: 8675309

Thumbnail best resize suprise

Post by Albireo »

Hi!
I have a lot of large images.
Now, I want to make as good as possible smaller images.
With IM, there are many different ways to make these transformations.

But how is the best way?
What commands should I use?

Should I always use "-sharpen" on the thumbnail to get the best result?
(there are many questions....)

Did an analysis of the following instructions

Code: Select all

convert -size 140x140 C:\Temp\Pic\7748790.jpg -thumbnail 120x120 image1.png
convert -size 140x140 C:\Temp\Pic\7748790.jpg -thumbnail 120x120 Image2.png
compare Image1.png Image2.png  ImageCompare.gif
To my surprise, I received a file with the differences between Image1 and Image2
(Believed that the image files would be equal :o )

//Jan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thumbnail best resize suprise

Post by fmw42 »

works fine for me on IM 6.5.9.-2 Q16 Mac OSX Tiger

convert -define jpeg:size=140x140 DSCN3194.jpg -thumbnail 120x120 tmp1.png
convert -define jpeg:size=140x140 DSCN3194.jpg -thumbnail 120x120 tmp2.png
compare -metric rmse tmp1.png tmp2.png null:
0 (0)


In recent changes the -size command as a read modifier of jpg has been changed to -define jpeg:size=

see http://www.imagemagick.org/Usage/formats/#jpg_read


what version of IM are you using? if old, perhaps time to upgrade.
Albireo
Posts: 68
Joined: 2010-01-12T03:32:23-07:00
Authentication code: 8675309

Re: Thumbnail best resize suprise

Post by Albireo »

fmw42 wrote:works fine for me on IM 6.5.9.-2 Q16 Mac OSX Tiger
...... compare -metric rmse tmp1.png tmp2.png null:
0 (0).........
I don't understand the command: "Compare -metric.....null:".
If I run the command, I also got 0 (0)

I use the example on the site: http://www.imagemagick.org/Usage/compare/ "Compare Program"
and if I run the command:

Code: Select all

compare Image1.png Image2.png   ImageComp.gif
the result is a picture with "everything on", but behind a fog

and, If I run the compose program like this:

Code: Select all

composite Image1.png Image2.png -compose difference ImageDiff.gif
convert ImageDiff.gif  -contrast-stretch 0  ImageDiffContrast.gif
I get an image that is completely black.
I don't know, but It might mean that the images are equally.

it may be that I missed something :)

My IM version is ImageMagick 6.5.8-7 Q16 2009-12-17 (PC-install)

//Jan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thumbnail best resize suprise

Post by fmw42 »

using

compare -metric rmse image1 image2 null:

tells compare to just present a statistics of the differences. Zero means no difference.

using

compare image1 image2 difference

will present an image with red where ever there is a difference and the image elsewhere

using

convert image1 image2 -compose difference result

will give totally black if no difference and white if totally different.
Post Reply