[SOLVED] IM6 and IM7 give very different -resize results

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

[SOLVED] IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

Bleeding edge, up to date, IM6 and IM7: svn rev 9368, both compiled in HDRI mode on up to date Linux Mint 12.

Code: Select all

convert rose: input_rose.jpg
convert input_rose.jpg -resize 500% IM6rose.jpg
magick input_rose.jpg -resize 500% IM7rose.jpg
The max difference between the two images is 39, which is huge.
-----
I'll try to narrow down the problem.
Last edited by NicolasRobidoux on 2012-09-18T09:49:16-07:00, edited 4 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

I think IM7 is the broken one.
Last edited by NicolasRobidoux on 2012-09-15T12:51:25-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

It's not a JPEG issue: Same if I use png.
Last edited by NicolasRobidoux on 2012-09-15T12:51:38-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

It's not a negative lobe issue: Same with -filter Triangle.
Last edited by NicolasRobidoux on 2012-09-15T12:51:52-07:00, edited 2 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

Just to make sure it's clear:

Code: Select all

convert -version
Version: ImageMagick 6.7.9-6 2012-09-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP  HDRI
magick -version
Version: ImageMagick 7.0.0-0 2012-09-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP  HDRI
Last edited by NicolasRobidoux on 2012-09-15T12:52:04-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

Not so sure it's IM7 that's broken.
Last edited by NicolasRobidoux on 2012-09-15T12:52:18-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

The bleeding edge IM6 compiled with everything default (make clean && ./configure && make && sudo make install) gives the exact same result as shown in http://www.imagemagick.org/Usage/resize ... _sigmoidal (IM v6.7.9-1) with the following command:

Code: Select all

convert rose: -colorspace RGB  -filter Lanczos  -resize 200x \
           -colorspace sRGB rose_resize_RGB.new.png
(And an extremely different result when compiled in HDRI, which is not surprising given the negative lobes.)
I don't know what is going on.
Last edited by NicolasRobidoux on 2012-09-15T12:52:31-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

I should go back to earlier IM7 and see if there is a difference, but I'll go buy winter tires instead.
Last edited by NicolasRobidoux on 2012-09-15T12:52:42-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

-distort resize appears to be fine.
It's a -resize issue.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: [SOLVED] IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

As of svn rev 9379, this seems to be fixed.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

Still broken:

Code: Select all

convert rose: input_rose.jpg
convert input_rose.jpg -resize 500% IM6rose.jpg
magick input_rose.jpg -resize 500% IM7rose.jpg
still gives different images.
What fooled me for a minute is that

Code: Select all

magick rose: -resize 500% IM7rose.jpg
convert rose: -resize 500% IM6rose.jpg
give identical images.
Last edited by NicolasRobidoux on 2012-09-15T17:18:04-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

A-ah! Could it be that IM6 and IM7 use different JPEG settings?

Code: Select all

convert rose: input_rose.png
convert input_rose.png -resize 500% IM6rose.png
magick input_rose.png -resize 500% IM7rose.png
do give identical images.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

No: convert rose: roseIM6.jpg (with IM6 convert) and magick rose: roseIM7.jpg give identical images.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

jpeg.c was just updated in both IM6 and IM7, but

Code: Select all

convert rose: input_rose.jpg
convert input_rose.jpg -resize 500% IM6rose.jpg
magick input_rose.jpg -resize 500% IM7rose.jpg
still gives different images.
For reference:

Code: Select all

magick -version
Version: ImageMagick 7.0.0-0 2012-09-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP  HDRI  
convert -version
Version: ImageMagick 6.7.9-7 2012-09-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP  HDRI
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM6 and IM7 give very different -resize results

Post by NicolasRobidoux »

Again for the record, this is how I compile both IM6 and IM7 (--enable-hdri is now unnecessary with IM7, but it should not hurt):

Code: Select all

make clean && CFLAGS="-march=native" CXXFLAGS="-march=native" ./configure --enable-hdri && make && sudo make install
Post Reply