convert -resize sometimes produces one-colored images
Posted: 2015-01-11T03:11:05-07:00
Resizing images sometimes reduces colors to just one color. This depend on the input file and the size reduction.
Running:
produces output like this:
The problem started with version 6.9.0-2, 6.9.0-0 was still fine.
Tests on different machines and with convert or PerlMagick gave me different amount of problematic resize sizes. Most problems I had with PerlMagick and use of the CGI module on a FreeBSD 10.1 server (about 88 one color images for 1000 sizes). Less problems when not using the CGI module(???) (about 69) and still less when using convert or system(convert -resize ...) (about 2 images with one color only).
So for now I revert to system calls, but they aren't save as well.
Did anyone observe similar behaviour?
Thomas Mack
Running:
Code: Select all
for f in $(seq 1 1000); do convert in.tif -verbose -resize x$f out.gif; done
Code: Select all
[...]
in.tif=>out.gif TIFF 7027x5426=>263x203 263x203+0+0 8-bit Palette sRGB 116c 44KB 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>264x204 264x204+0+0 8-bit Palette sRGB 115c 44.3KB 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>265x205 265x205+0+0 8-bit Palette sRGB 1c 356B 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>267x206 267x206+0+0 8-bit Palette sRGB 121c 45.3KB 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>268x207 268x207+0+0 8-bit Palette sRGB 115c 45.3KB 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>269x208 269x208+0+0 8-bit Palette sRGB 115c 46KB 0.000u 0:00.000
in.tif=>out.gif TIFF 7027x5426=>271x209 271x209+0+0 8-bit Palette sRGB 120c 46.5KB 0.000u 0:00.000
[...]
Tests on different machines and with convert or PerlMagick gave me different amount of problematic resize sizes. Most problems I had with PerlMagick and use of the CGI module on a FreeBSD 10.1 server (about 88 one color images for 1000 sizes). Less problems when not using the CGI module(???) (about 69) and still less when using convert or system(convert -resize ...) (about 2 images with one color only).
So for now I revert to system calls, but they aren't save as well.
Did anyone observe similar behaviour?
Thomas Mack