Dear all,
I have a script which converts raw date (unsigned 16bit integer) from an MRI maschin to png etc.
I use the command:
convert -endian LSB -size 256x256 -depth 16 -normalize +adjoin gray:$file $outfilename\_%03d.png
Till 6.7.6 (including) I got multiple images all nice scaled.
I upgraded on Windows to 6.7.8.2 and suddendly only the first image was fine, but all the other once were nearly binary. Bright areas white, and lower intensity were black.
An bugfix for my scripts was to switch to
convert -endian LSB -size 256x256 -depth 16 -auto-levl +adjoin gray:$file $outfilename\_%03d.png
But I think, there went something wrong during one of the the latest improvments.
Thanks for your help.
Roger
Problem with -normalize in 7.6.8 for gray scale images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with -normalize in 7.6.8 for gray scale images
Don't know about the normalize issue?
But you have a typo?
-normalize is a subset of -contrast-stretch, so you may want to check that. See
http://www.imagemagick.org/script/comma ... st-stretch
http://www.imagemagick.org/script/comma ... #normalize
Note that as of ImageMagick 6.4.7-0, -normalize is equivalent to -contrast-stretch 2%x1%. (Before this version, it was equivalent to -contrast-stretch 2%x99%).
But you have a typo?
It should be -auto-level not -auto-levlconvert -endian LSB -size 256x256 -depth 16 -auto-levl +adjoin gray:$file $outfilename\_%03d.png
-normalize is a subset of -contrast-stretch, so you may want to check that. See
http://www.imagemagick.org/script/comma ... st-stretch
http://www.imagemagick.org/script/comma ... #normalize
Note that as of ImageMagick 6.4.7-0, -normalize is equivalent to -contrast-stretch 2%x1%. (Before this version, it was equivalent to -contrast-stretch 2%x99%).
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problem with -normalize in 7.6.8 for gray scale images
Also actually read in the image BEFORE using -auto-level
+adjoin being an output option should be just before the output (not that it should matter a lot).
+adjoin being an output option should be just before the output (not that it should matter a lot).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Problem with -normalize in 7.6.8 for gray scale images
Thanks for the replys.
auto-level was a typo sorry.
Anyway even after moving +adjoin further to the end and with using -contrast-stretch 0 there is still a error in my opinion.
To illustrate I put the data and the converted images to my webpage:
OK is the command with the old Image magick 6.7.6:
"C:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -normalize gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... ize/6_7_6/
With the newest version 6.7.8 it does not work (first image OK, rest have bad dynamic range)
"C:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -normalize gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... ize/6_7_8/
Bad images also with -contrast-stretch
"C:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -contrast-stretch 0 gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... t_stretch/
OK if I switch to auto-level
"C:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -auto-level gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... uto_level/
The raw data to test and the commands:
http://www.mr.ethz.ch/~rluchin/image_ma ... /raw_data/
For me the problem is solve by switching to autolevel, but I still think there is a bug in the software, which may be a problem to others in future.
To the used versions:
6.7.8-2
"c:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -version
Version: ImageMagick 6.7.8-2 2012-07-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
6.7.6-5
"c:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -version
Version: ImageMagick 6.7.6-5 2012-04-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Kind regards
Roger
auto-level was a typo sorry.
Anyway even after moving +adjoin further to the end and with using -contrast-stretch 0 there is still a error in my opinion.
To illustrate I put the data and the converted images to my webpage:
OK is the command with the old Image magick 6.7.6:
"C:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -normalize gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... ize/6_7_6/
With the newest version 6.7.8 it does not work (first image OK, rest have bad dynamic range)
"C:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -normalize gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... ize/6_7_8/
Bad images also with -contrast-stretch
"C:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -contrast-stretch 0 gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... t_stretch/
OK if I switch to auto-level
"C:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -endian LSB -size 256x256 -depth 16 -auto-level gray:test.rec +adjoin test_%03d.png
Images: http://www.mr.ethz.ch/~rluchin/image_ma ... uto_level/
The raw data to test and the commands:
http://www.mr.ethz.ch/~rluchin/image_ma ... /raw_data/
For me the problem is solve by switching to autolevel, but I still think there is a bug in the software, which may be a problem to others in future.
To the used versions:
6.7.8-2
"c:\Program Files (x86)\ImageMagick-6.7.8-Q16\convert.exe" -version
Version: ImageMagick 6.7.8-2 2012-07-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
6.7.6-5
"c:\Program Files (x86)\ImageMagick-6.7.6-Q16\convert.exe" -version
Version: ImageMagick 6.7.6-5 2012-04-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Kind regards
Roger
-
- Posts: 2
- Joined: 2012-09-12T00:39:13-07:00
- Authentication code: 67789
Re: Problem with -normalize in 7.6.8 for gray scale images
Hi
I have this problem too. Just regressed from 6.7.8.7 to 6.7.6.4 and everything works as expected.
I use normalize while creating a simple button:
with 6.7.6.4 the button has a mid-grey field, goes to white in top left and black in bottom right.
with 6.7.8 the button has a white field and goes to black in bottom right.
Using -contrast-stretch 2%x99% instead of -normalize had no effect (same as if I had not used the option at all).
Hope this helps?
I have this problem too. Just regressed from 6.7.8.7 to 6.7.6.4 and everything works as expected.
I use normalize while creating a simple button:
Code: Select all
/usr/bin/convert /tmp/tile.png -fill gray45 -colorize 100% -raise 4 -normalize -blur 0x4 grey_norm.png
with 6.7.8 the button has a white field and goes to black in bottom right.
Using -contrast-stretch 2%x99% instead of -normalize had no effect (same as if I had not used the option at all).
Hope this helps?
Re: Problem with -normalize in 7.6.8 for gray scale images
We can reproduce the problem and have a patch in ImageMagick 6.7.9-5 Beta available by sometime tomorrow. In the mean-time add '-colorspace RGB' just before the -normalize option. The -colorspace GRAY option may work as well.
-
- Posts: 2
- Joined: 2012-09-12T00:39:13-07:00
- Authentication code: 67789
Re: Problem with -normalize in 7.6.8 for gray scale images
Thanks very much.