Page 1 of 1

Having problems changing the brightness of B/W tiff.

Posted: 2008-01-22T17:34:56-07:00
by BrianK
With the image below, I can't seem to change the brightness. What I'm going for is a washed out '15' - i.e. one that not black/white, but gray/white. I don't want to use fill to change one color to another because I can't guarantee the colors will be black & white... they may be red/black, red/blue, whatever/whatever.

I've tried the following commands:
  • convert /tmp/b/num.0015.tif -modulate 150 foo.tif
  • composite -dissolve 50% /tmp/white.png /tmp/b/num.0011.tif foo.tif (all incarnations, i.e. order of args. "white.png" is an image of all white)
  • convert /tmp/b/num.0015.tif -fill "rgb(50%,50%,49%)" -fuzz 5% -opaque "rgb(0,0,0)" foo.tif (this works, but locks in black & white - which is bad. Anecdote: this does not work if I use (50%,50%,50%), as opposed to (50%,50%,49%) - bug?)
Image
The image is at http://hero.com/~briank/misc/num.0015.tif if you can't view it in the browser.

Edited to add: The above image was created as a tiff with an alpha then I removed the alpha with imagemagick using the +matte command & inverted (also with image magick) it so now the 15 is black & background is white. I'm running Debian Linux with Version: ImageMagick 6.0.6 05/30/07 Q16 (which I believe is straight from the Debian Repository)

Re: Having problems changing the brightness of B/W tiff.

Posted: 2008-01-24T17:35:47-07:00
by fmw42
You have a binary (1-bit) tif image. Perhaps you need to convert it to grayscale first, before doing any processing.

convert num.0015.tif -depth 8 num.0015_d8.tif

or

convert num.0015.tif -type Grayscale num.0015_tg.tif


Both will make an 8-bit image.

Re: Having problems changing the brightness of B/W tiff.

Posted: 2008-01-24T18:08:19-07:00
by BrianK
fmw42 wrote:You have a binary (1-bit) tif image. Perhaps you need to convert it to grayscale first, before doing any processing.
How about that. I didn't notice that it had been converted to 1 bit.

For the record, the initial image was 8 bit, but my removing of the alpha via imagemagick's "convert +matte" dropped it down to 1 bit. I'll throw that -depth option in that part of the conversion.

Thanks!