-define jpeg:fancy-upsampling=off ignored w/ convert

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.
Post Reply
newtron
Posts: 3
Joined: 2015-03-11T17:57:39-07:00
Authentication code: 6789

-define jpeg:fancy-upsampling=off ignored w/ convert

Post by newtron »

I believe -define jpeg:fancy-upsampling=off is being ignored with convert but not with mogrify. Given this image and these two commands, I'd expect the same output:

Code: Select all

mogrify -path ./ -filter Triangle -define filter:support=2.0 -thumbnail 1200 -unsharp 0.25x0.25+8.00+0.065 -dither None -posterize 136 -background Black -alpha Background -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip ../assets-unoptimized/1A-1.jpg

Code: Select all

convert ../assets-unoptimized/1A-1.jpg -filter Triangle -define filter:support=2.0 -thumbnail 1200 -unsharp 0.25x0.25+8.00+0.065 -dither None -posterize 136 -background Black -alpha Background -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip ./1A-1-convert.jpg
…but the output is different: 1A-1.jpg is 141125 bytes and 1A-1-convert.jpg is 141133 bytes. If I use identify -verbose, they differ in mean, standard deviation, kurtosis, and skewness in the red, green, and blue channels, and overall.

If, however, I do the same commands but leave off -define jpeg:fancy-upsampling=off:

Code: Select all

mogrify -path ./ -filter Triangle -define filter:support=2.0 -thumbnail 1200 -unsharp 0.25x0.25+8.00+0.065 -dither None -posterize 136 -background Black -alpha Background -quality 82 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip ../assets-unoptimized/1A-1.jpg

Code: Select all

convert ../assets-unoptimized/1A-1.jpg -filter Triangle -define filter:support=2.0 -thumbnail 1200 -unsharp 0.25x0.25+8.00+0.065 -dither None -posterize 136 -background Black -alpha Background -quality 82 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip ./1A-1-convert.jpg
…then the outputs are identical @ 141133 bytes.

This is happening with v6.8.9-8 Q16 on Mac OS X Yosemite.

Code: Select all

Version: ImageMagick 6.8.9-8 Q16 x86_64 2015-02-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg lcms lqr ltdl lzma png tiff webp xml zlib
schel4ok
Posts: 18
Joined: 2015-08-31T10:38:58-07:00
Authentication code: 1151

Re: -define jpeg:fancy-upsampling=off ignored w/ convert

Post by schel4ok »

hello,

I have problem with your script. If I do this, it is OK.

Code: Select all

mogrify -path ../out1 -filter Triangle -define filter:support=2 -thumbnail 640 \
-unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 \
-define jpeg:fancy-upsampling=off -define png:compression-filter=5 \
-define png:compression-level=9 -define png:compression-strategy=1 \
-define png:exclude-chunk=all -interlace none -colorspace sRGB *
but if I do this

Code: Select all

smartresize() {
   mogrify -path $3 -filter Triangle -define filter:support=2 -thumbnail $2 \
   -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 \
   -define jpeg:fancy-upsampling=off -define png:compression-filter=5 \
   -define png:compression-level=9 -define png:compression-strategy=1 \
   -strip -define png:exclude-chunk=all -interlace none -colorspace sRGB $1
}

smartresize resources/img/* 640 out/
then I have error

Code: Select all

$ sh images.sh
mogrify.exe: invalid argument for option `resources/img/avangard.png': -thumbnail @ error/mogrify.c/MogrifyImageCommand/6200.
I have imagemagick installe in Open Server 5.2.3 (local server for Windows)

Code: Select all

$ convert -version
Version: ImageMagick 6.8.9-9 Q16 x86 2014-10-19
$ uname -a
MINGW32_NT-6.1 WIN-SV4R9NF6R3V 1.0.12(0.46/3/2) 2012-07-05 14:56 i686 unknown
schel4ok
Posts: 18
Joined: 2015-08-31T10:38:58-07:00
Authentication code: 1151

Re: -define jpeg:fancy-upsampling=off ignored w/ convert

Post by schel4ok »

I found reason of this problem.
I just needed to change directory to default
Post Reply