Simple Color And Shading Change

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mcmanud
Posts: 2
Joined: 2013-03-28T12:04:33-07:00
Authentication code: 6789

Simple Color And Shading Change

Post by mcmanud »

I have a tiff file that is mostly white with some red lines and characters. There is just one red color. I need to change this to black with 80% shading. (Or what Corel Draw would call 80% shading) All of my attempts to change the color to black produce a totally black page. Does someone have a recommendation? My attempts are below.

convert +level-colors 'rgb(0,0,0)', 3251-1909.tif Black3251-1909.tif

convert 3251-1909.tif +level 0%,50% Black3251-1909.tif

convert 3251-1909.tif +level-colors black, Black3251-1909.tif
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Simple Color And Shading Change

Post by snibgo »

I'm not clear on exactly what you want. If you want to turn all red pixels black:

Code: Select all

convert 3251-1909.tif -fill black -opaque red Black3251-1909.tif
I don't what "black with 80% shading" is. Perhaps it corresponds to 20% in each of the RGB channels, which is quite dark.

Code: Select all

convert 3251-1909.tif -fill rgb(20%,20%,20%) -opaque red Black3251-1909.tif
snibgo's IM pages: im.snibgo.com
mcmanud
Posts: 2
Joined: 2013-03-28T12:04:33-07:00
Authentication code: 6789

Re: Simple Color And Shading Change

Post by mcmanud »

Yes, I'm trying to change all red pixels black. Since red is the only color it would also be to change all colored pixels black. The red is rgb(232,17,45) if that makes a difference.

This will be a print file for a laser etching machine. The 80% is a dot matrix pattern with 80% of coverage. Corel Draw calls it shading

I tried those two options but still get a completely black page. The format of the file is:
360 DPI TIFF, 1944 x 1500 pixels, 24 bit depth, Uncompressed, Resolution Unit 1

Thanks for looking at this.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Simple Color And Shading Change

Post by snibgo »

Okay. To IM, "red" means "rgb(255,0,0)". But your colour is "rgb(232,17,45)". So:

Code: Select all

convert 3251-1909.tif -fill black -opaque rgb(232,17,45) Black3251-1909.tif
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Simple Color And Shading Change

Post by fmw42 »

or use red with -fuzz XX%
Post Reply