flattening tiff with layermask on it

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?".
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

flattening tiff with layermask on it

Post by db2346 »

OK, I have been fighting this one for a few days. I am needing to flatten tiffs with either a feathered layer mask on them or transparency made by said masks. I can feed either I need into the system.

I have a flattened tiff now, but I am getting horrible noise connected to the edged of the mask. Anyone know what Image Magic I need to use in the the command line world got make this go away?

http://i.imgur.com/hxj3j.jpg

sorry, vital stats
ImageMagick-6.2.8.0-4.el5_5.3
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: flattening tiff with layermask on it

Post by anthony »

Can you give use the source image, and command you use.

It is hard to tell what is going one without known your exact input and process you are trying to use.

You can crop the images to a section if they are large or you don't want to supply the whole original.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

Yse, sorry, I am using the convert -background white -flatten

at least that is the one that has a few successes.

not sure how to post a tif but here is a imgur processed tiff. if you can help me i would be happy to pass the tiff on.
http://i.imgur.com/uHcpq.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

post the tiff the same way you posted the png. then give us the exact full command line you used and explain what is wrong. To feather the edges of the mask, you can use -blur radx65000 -level 50x100% assuming the mask is white and black and white is where you want to keep your image. see http://www.fmwconcepts.com/imagemagick/ ... composite2
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

http://ftp.iridio.com/

login bob
pw bob

I am actually calling the program out of a thrid party but I can call any shell scripts out of it. I am using

convert -background white -flatten bob.tiff

I can not feather the mask in that it is a cut mask by a photoshop operator that we are sometimes flattening, sometimes disabling. When we flatten the image, we want the mask to represent the work of the operator.

we have an automated process that picks up the images and flattens them.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

db2346 wrote: I can not feather the mask in that it is a cut mask by a photoshop operator that we are sometimes flattening, sometimes disabling. When we flatten the image, we want the mask to represent the work of the operator.

Then please explain your request or clarify the problem as you first asked about feathering.
db2346 wrote:OK, I have been fighting this one for a few days. I am needing to flatten tiffs with either a feathered layer mask on them or transparency made by said masks
So now I am not sure what you want to do
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

I am sorry, I am complaining about the noise in the feathered edge. Where you see that noise in the initial image, that is where the edge of the mask is feathering out. If I blur/feather more then the integrity of the mask will be damaged.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

db2346 wrote:I am sorry, I am complaining about the noise in the feathered edge. Where you see that noise in the initial image, that is where the edge of the mask is feathering out. If I blur/feather more then the integrity of the mask will be damaged.
How did you create that image? What were you exact commands? Can you provide the input images so others can test you commands?
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

convert -flatten -background white jeff.tiff bob.tiff

I know i am hardly scratching the surface of this tool. I really have only been working with it a few days trying to get this automation done but I can see already the usefulness of it. I can see pulling it more and more into workflows.

Thanks in advance for your help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

Can you provide the input images so others can test you commands? How did you create the mask or alpha channel?
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

the ftp link above is the input image. it was a photoshop tif that had the mask applied through a program called Claro which is a java image enhancement software product.

the mask was made in photoshop and is a testing image to identify the problem i am seeing.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

without seeing the image and mask before the result, it is hard to tell what is happening. sounds like your other program that applied the mask may be the culprit.
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

I am sorry. Can you not access the ftp site? It is an enterprise FTP solution.

FTP://Iridio.com
Bob is both the log in and the password all lower case. I made this just for you. Please let me know that you can or can not access this. It is difficult to find a online hosting site that will allow for tiff upload.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: flattening tiff with layermask on it

Post by fmw42 »

I got your file. The lousy aliasing appears to be coming from the broad white outline in the underlying image and not the alpha channel itself. Look at the result of

convert bob.tiff -alpha extract bob_alpha.tif

convert bob.tiff -alpha off bob_aoff.tif

and your original.
db2346
Posts: 16
Joined: 2011-09-29T14:32:10-07:00
Authentication code: 8675308

Re: flattening tiff with layermask on it

Post by db2346 »

I am getting a Unrecognized command error on my 4 boxes. I notice that Red Hat version is behind the common listed frequent version. It was explained the Red Hat is "controling" versioning from a friend. Does anyone know if this is the cause of Unrecognized command. Does anyone know if bumping forward will cause a problem with Red Hat?

IM version on this box

6.2.8.0-4.el5_5.3

Red Hat version

Red Hat Enterprise Release 5.5
Post Reply