I'm using a GraphicsMagick package for image processing
When converting Illustrator (.ai) files to .png files, I end up losing transparency so the background ends up white.
I don't have this problem when using the same options and converting with ImageMagick, but I need a solution to make it work with GraphicsMagick specifically.
I don't have much experience with GraphicsMagick, but I would assume that the behavior of -background is the same as ImageMagick's:
gm convert -background transparent source.ai out.png
Note: This works by defining the background before reading the vector graphic
Related
I have some source images which have a black background, and I would like to convert them into WebP images that have a transparent background.
I don't understand the talk about alpha channels from their documentation, so I am unsure if this is even possible with cwebp. I tried some guesswork with the arguments, but none worked.
The command I use for direct conversion from JPG to WebP is:
cwebp ./input.jpg -o ./output.webp
What would I need to add to this in order to get the black background from the input JPG to be transparent in the output WebP?
I think cwebp's options are mostly focused on compression with some limited other options for manipulating the image like cropping and sharpness.
To accomplish this task I would recommend image magick which is a general purpose image manipulation tool. that can remove the transparency, and then you can send that to cwebp.
imagick convert image.jpg -fuzz 2% -transparent black image.png
cwebp image.png -o image.webp
I am trying to create a PDF file using Latex. However, Latex does not handle TIFF or any other image format capable of both transparency and CMYK. The only solution I think I can use is to convert the PNG image to PDF and embed those in the file.
I am somewhat familiar with imagemagick, however, I am having trouble figuring out how to convert a PNG (probably in the RGB/SRGB colour space) to a PDF in the CMYK colour space.
How do I go about doing this conversion so that the colours are correct and the transparency remains?
In Imagemagick, you should use a CMYK type profile to do the conversion:
convert input.png -profile USWebCoatedSWOP.icc output.pdf
Note, however, that Imagemagick will simply put the raster image into a vector PDF shell. It will not vectorize the image.
I have tried adding the option -depth 12 to the string
convert transparentPNG.png -resize 500x400 -background white -flatten -depth 12 png_small.jpg
The input file is a transparent png to which I'm adding a background and then changing the depth. But the depth remains the same as 8bits. I verified the same using the -verbose.
I'm not sure what could I be doing wrong here. I'm referring to the site link
The transparent input png file used for my test can be found here
Let me know if you have any questions on the tests i did. Hoping to get some tips.
A JPG can only be 8-bit, so your internal 12-bit image is converted back to 8-bit when you save the result.
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?
Although TIFF format, technically, does support transparency, it is a dark matter in general. Even some Adobe applications do not support this correctly, if ever. Perhaps, neither does your application; or it may have support in theory, but messes something upon format-to-format conversion.
I'm importing SVGs with imagick using this syntax
$graphic = new Imagick($this->img);
The problem is this image is imported with a white background. How can I change the white background to a transparent one, or make imagick keep then transparent background when importing the SVG.
I can't help you with imagick. However, I know that an SVG with a transparent background gets converted to a PDF with transparent background if I use this ImageMagick ClI command:
convert -background none some.svg some.pdf
and if I use
convert -background gray some.svg some.pdf
the PDF indeed has a gray background.