.TIF file turns "reverse video"
.TIF file turns "reverse video"
I open a .tif file, and do some manipulation (e.g. image::crop, but I think I've seen it happening elsewhere).
Then I write out the image to a .tif file again.
When I view the file it looks like all the blacks are white and all the whites are black.
Can anyarne explain this? Thanks!
Pito
Then I write out the image to a .tif file again.
When I view the file it looks like all the blacks are white and all the whites are black.
Can anyarne explain this? Thanks!
Pito
Re: .TIF file turns "reverse video"
Post a URL to your image so we can download it an reproduce the problem. Also post the ImageMagick version you are using.
Re: .TIF file turns "reverse video"
# Program that shows problem
require 'rubygems'
require 'RMagick'
include Magick
img = ImageList.new("regular.tif")
img = img[0].rotate(1.0)
img.write("reverse.tif")
# Input file http://www.salas.com/elect/regular.tif
# Output file http://www.salas.com/elect/reverse.tif
require 'rubygems'
require 'RMagick'
include Magick
img = ImageList.new("regular.tif")
img = img[0].rotate(1.0)
img.write("reverse.tif")
# Input file http://www.salas.com/elect/regular.tif
# Output file http://www.salas.com/elect/reverse.tif
Re: .TIF file turns "reverse video"
Perhaps there is a problem with your release of ImageMagick. We're using ImageMagick 6.5.3-7 and the conversion produces the expected results (i.e. no reverse video):
- -> convert regular.tif reverse.tif
-> compare -metric rmse regular.tif reverse.tif null:
0 (0)
Re: .TIF file turns "reverse video"
Hmm.. I am using
ImageMagick 6.5.1-0 2009-04-24 Q16 http://www.imagemagick.org
The date seems so recent that I didn't imaging it was out of date
Let me update and see if things get better...
Thanks,
Pito
ImageMagick 6.5.1-0 2009-04-24 Q16 http://www.imagemagick.org
The date seems so recent that I didn't imaging it was out of date
Let me update and see if things get better...
Thanks,
Pito
Re: .TIF file turns "reverse video"
Do you know who maintains the Mac Ports version of ImageMagick? Because when I distribute my software it will be a pain if it requires a non-ports install. Right now the Ports version is the one I am using and that apparently has the problem. Any chance of updating the ports version with the latest?
Re: .TIF file turns "reverse video"
Verify the bug exists. Type
- -> convert regular.tif reverse.tif
-> compare -metric rmse regular.tif reverse.tif null:
Re: .TIF file turns "reverse video"
Here's what I get:
$ convert regular.tif reverse.tif
$ compare -metric rmse regular.tif reverse.tif null:
0 (0) @ 0,0
But what do those steps do and how are they checking that the reverse video isn't happening when I do a rotate?
$ convert regular.tif reverse.tif
$ compare -metric rmse regular.tif reverse.tif null:
0 (0) @ 0,0
But what do those steps do and how are they checking that the reverse video isn't happening when I do a rotate?
Re: .TIF file turns "reverse video"
Are you rotating by 1 degree? When you do, it promotes your monochrome image to truecolor. To restore the original 1-bit image use this command:
- convert regular.tif -rotate 1 -threshold 50% image.tif
Re: .TIF file turns "reverse video"
Yes I was rotating by 1 degree so that probably explains that.
1) are there any ways to rotate a b&w image that don't turn it to true color?
2) I missed the color conversion side effect of rotate in the doc; is there a reference of what other functions do that? And does it have anything to do with the file starting out as a .tif?
Thanks as usual for the excellent help!!
- Pito
1) are there any ways to rotate a b&w image that don't turn it to true color?
2) I missed the color conversion side effect of rotate in the doc; is there a reference of what other functions do that? And does it have anything to do with the file starting out as a .tif?
Thanks as usual for the excellent help!!
- Pito
Re: .TIF file turns "reverse video"
The problem appears to be saving 1-bit TIFF images with an alpha channel, we're investigating. The alpha channel is created when you rotate. From the command line you can turn it off with the +matte option. Try it and see if that fixes the problem.
Re: .TIF file turns "reverse video"
With RMagick it didn't seem to work, in other words, revers1.tif still is reverse video:
require 'rubygems'
require 'RMagick'
include Magick
img = ImageList.new("regular.tif")
img = img[0]
img.alpha(DeactivateAlphaChannel)
img = img.rotate(1.0)
img.write("revers1.tif")
Opposite results on the command line -- reverse2.tif is looks ok:
convert -rotate 1 +matte regular.tif reverse2.tif
require 'rubygems'
require 'RMagick'
include Magick
img = ImageList.new("regular.tif")
img = img[0]
img.alpha(DeactivateAlphaChannel)
img = img.rotate(1.0)
img.write("revers1.tif")
Opposite results on the command line -- reverse2.tif is looks ok:
convert -rotate 1 +matte regular.tif reverse2.tif
Re: .TIF file turns "reverse video"
I can see this happen even when there's no rotate (directly) involved. Also I don't understand how the transparency layer could make the image look 'reverse video'. So it doesn't seem to me to be tied to rotate. Does anyone see what might be going on?