Page 1 of 1

Changing a grayscaled TIF to Color

Posted: 2009-06-01T09:37:10-07:00
by Catchen
Hi,
I have been using ImageMagick for about a week and are totaly hooked by this great application.
I've done a few cool things with it and searching to learn more. Well now to the problem.

I have a bunch of TIF files. These files are drawings Black & White ones.
If I try to draw lets say a rectangle in color with IM it the rectangle becomes grey.
convert test.tif -fill red -draw "rectangle 100x100 400x400" redrect.tif

I started to search for icc profiles, colorspace etc but couldnt get these files to open up for color.

Im a total newbie and I understand that some would say RTFM but after reading until my eyes got crazy and still not finding a solution I ask you guys.
Maby im dumb or even blind :D but I would love to get some help with this..

the identify -verbose tells

Image: test.tif
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 3296x2320+0+0
Resolution: 200x200
Print size: 16.48x11.6
Units: PixelsPerInch
Type: Bilevel
Base type: Bilevel
Endianess: MSB
Colorspace: RGB
Depth: 1-bit
Channel depth:
gray: 1-bit
Channel statistics:
gray:
min: 0 (0)
max: 1 (1)
mean: 0.928214 (0.928214)
standard deviation: 0.258133 (0.258133)
kurtosis: 9.00764
skewness: -3.31778
Histogram:
7097793: (255,255,255) #FFFFFF white
548927: ( 0, 0, 0) #000000 black
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Page geometry: 3296x2320+0+0
Dispose: Undefined
Iterations: 0
Compression: Group4
Orientation: TopLeft
Properties:
create-date: 2009-05-29T15:47:49+02:00
modify-date: 2003-08-22T11:52:06+02:00
signature: 98b92cf80940852b2a03fada4695edfb32ef080e04cdf094d8de69d2c73b9b72
tiff:rows-per-strip: 2320
Artifacts:
verbose: true
Tainted: False
Filesize: 38.9kb
Number pixels: 7.292mb
Version: ImageMagick 6.5.2-9 2009-05-26 Q16 OpenMP http://www.imagemagick.org

Kind regards
/Total newbie Catchen

Re: Changing a grayscaled TIF to Color

Posted: 2009-06-01T11:01:19-07:00
by fmw42
try changing the image type from bilevel to truecolor

convert test.tif -type truecolor -fill red -draw "rectangle 100x100 400x400" redrect.tif

see -type http://www.imagemagick.org/script/comma ... s.php#type

Does that work?

alternately, try setting the -channel

convert test.tif -channel rgb -fill red -draw "rectangle 100x100 400x400" redrect.tif

Re: Changing a grayscaled TIF to Color

Posted: 2009-06-02T01:16:36-07:00
by Catchen
fmw42 wrote:try changing the image type from bilevel to truecolor

convert test.tif -type truecolor -fill red -draw "rectangle 100x100 400x400" redrect.tif

see -type http://www.imagemagick.org/script/comma ... s.php#type

Does that work?

alternately, try setting the -channel

convert test.tif -channel rgb -fill red -draw "rectangle 100x100 400x400" redrect.tif
Thanks for answering my question, really appreciate it.
I tried your exampels setting type and channel. It didnt work.
I just cannot understand these TIF's. If I create a new TIF in photoshop or mspaint theres no problem at all drawing with color. I can save and open it again no problem and the colors are still there. The difference is that these not working tif images has been imported from a scanner with some weird software.

If i use -type truecolor it generetes a corrupt tif

-channel rgb generates a TIF that can be opened but no colors.

I Will try some various things within the day and report later on. :D

Seems likes IM wont convert rect.tif -fill red -draw "rectangle 100x100 200x200" redrect.tif
at all. Doesnt draw the rectangle. Works with all the other imageformats I tried, jpg,png,gif

Re: Changing a grayscaled TIF to Color

Posted: 2009-06-02T10:42:13-07:00
by fmw42
post an example of your tif so that the IM folks and others can examine it and test with it