Hi Guys,
I am trying hard to convert PNGs to TIFFs using a Batch File. However, the resulting files lack transparency.
S:\*.*\mogrify -path H:\*.*\blau -format tiff H:\*.*\Raw\*.png
pause
S:\*.*\mogrify -fuzz 20%% -fill blue -opaque black H:\*.*\blau\*.tiff
S:\*.*\mogrify -colorspace cmyk H:\*.*\blau\*.tiff
S:\*.*\mogrify -fuzz 60%% -transparent white H:\*.*\blau\*.tiff
The TIFFs have a white background afterwards which I have verified using PhotoShop. What is wrong here? How can I get the resulting files to not lose transparency?
Convert PNG to TIFF with Transparency and CMYK
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PNG to TIFF with Transparency and CMYK
use colors that include the alpha channel. see http://www.imagemagick.org/script/color.php
example rgba(....)
example rgba(....)
Re: Convert PNG to TIFF with Transparency and CMYK
But theres nothing like CMYKa, is it?
Imagemagick doesnt support RGBA? If i try -colorspace rgba i get an error
Edit:
Tried SRGB... I can see a Black part on the right side now?
Edit Edit:
Here comes the tricky thing: If I do it with convert and only 1 pic at a time it works...!! WHY?!
Imagemagick doesnt support RGBA? If i try -colorspace rgba i get an error
Edit:
Tried SRGB... I can see a Black part on the right side now?
Edit Edit:
Here comes the tricky thing: If I do it with convert and only 1 pic at a time it works...!! WHY?!
Code: Select all
convert -transparent white objekt.jpg objekt.tiff
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PNG to TIFF with Transparency and CMYK
Yes, you can specify CMYKA colors. But there is no rgba or cmyka colorspace. The alpha is not specified in the colorspace conversion.But theres nothing like CMYKa, is it?
See http://www.imagemagick.org/script/color.php
However, for some reason it does not show that. However, you should be able to use the color converter link and get CMYKA values or specify CMYKA values.
This should work if you specify colors as rgba(...)
S:\*.*\mogrify -fuzz 20%% -fill blue -opaque black H:\*.*\blau\*.tiff
I am not sure here why you want to change colorspace?
S:\*.*\mogrify -colorspace cmyk H:\*.*\blau\*.tiff
This won't work as the -transparent will start over creating a new alpha channel
S:\*.*\mogrify -fuzz 60%% -transparent white H:\*.*\blau\*.tiff
Re: Convert PNG to TIFF with Transparency and CMYK
I tried to specify the alpha channel the whole day...
The point is, that if I do it with convert it works without any problems on my desktop... by changing to my network drive it wont work at all! (with mogrify AND convert...)
And I have to change it to cmyk afterwards... maybe I posted a script with a test... ^^
Ahhhh and the color changing from blue to black works perfectly, the TRANSPARENCY doesnt work =(
The point is, that if I do it with convert it works without any problems on my desktop... by changing to my network drive it wont work at all! (with mogrify AND convert...)
And I have to change it to cmyk afterwards... maybe I posted a script with a test... ^^
Ahhhh and the color changing from blue to black works perfectly, the TRANSPARENCY doesnt work =(
Re: Convert PNG to TIFF with Transparency and CMYK
I tried now:
Doesnt work at ALL!! >.< what am I doing wrong... There is no transparency afterwards... even if I try it with 0.0 in the alpha channel
Code: Select all
*.*\ImageMagick\mogrify -path \\*.*\blau -format tiff -fuzz 20%% -fill "rgba( 0, 0, 255, 1.0)" -opaque black -fuzz 20%% -transparent white \\*.*\Raw\*.png
*.*\ImageMagick\mogrify -fuzz 60%% -transparent "rgba( 255, 255, 255, 1.0)" *.*\*.tiff
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PNG to TIFF with Transparency and CMYK
post a link to your image, so we can test with it.
also try replacing black in the first command with "rgba(0,0,0,1)"
using -transparent is not going to do what you want as it will destroy your alpha channel and make a new one
also try replacing black in the first command with "rgba(0,0,0,1)"
using -transparent is not going to do what you want as it will destroy your alpha channel and make a new one
Re: Convert PNG to TIFF with Transparency and CMYK
Hi,
I'm not allowed to post one of these pictures as they contain personal information of our clients.. =(
well... but how can I achieve transparency without using -transparent?
with -fill "rgba( 0, 0, 255, 0.0)" -opaque "rgba( 0, 0, 255, 1.0)"?
I'm not allowed to post one of these pictures as they contain personal information of our clients.. =(
well... but how can I achieve transparency without using -transparent?
with -fill "rgba( 0, 0, 255, 0.0)" -opaque "rgba( 0, 0, 255, 1.0)"?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PNG to TIFF with Transparency and CMYK
That should work to make opaque blue into transparent blue without changing any existing transparency. You may have to add -alpha on -channel rgba before that, but not sure without testing.with -fill "rgba( 0, 0, 255, 0.0)" -opaque "rgba( 0, 0, 255, 1.0)"?
I don't recall that you have identified your version of IM or platform. So if you have an old version of IM it may have a bug.
The following works for me.
# create transparency for white
convert logo: -transparent white logo1.png
# add transparency for some shades of blue
convert logo1.png -alpha on -channel rgba -fuzz 30% -fill "rgba(0,0,255,0)" -opaque "rgba(0,0,255,1)" logo2.png
Test that and see if it works for you.