0

Is there a way in Jmagick to make a png image transparent?

Input: A PNG image
Output: A transparent PNG image

I want the background of an image to be transparent.

miserable
  • 697
  • 1
  • 12
  • 31
  • What do you mean by making it transparent? Do you want the whole image to be fully transparent? Do you want just part of the image to fully transparent? If the latter which parts. Perhaps you should provide your image and explain what part you want transparent. In ImageMagick command line to turn some color to transparent, the command would `convert image -fuzz XX% -transparent somecolor result`, where XX% is some percent near the color that you want to include. Sorry, I do not know Jmagick. See transparentImage at http://www.jmagick.org/jmagick-doc/ – fmw42 Nov 14 '18 at 04:22
  • I want the background of an image to be transparent. Updated my original question. – miserable Nov 15 '18 at 04:11
  • It would help to see your input image! What is the current background? Is it a constant color? Is it some other texture or general image? We cannot help with such little information. There are too many ways to do that, which depend on the image content. – fmw42 Nov 15 '18 at 06:38

1 Answers1

0

Your question is quite unclear, but if you mean you want to ensure that a PNG image is saved with an alpha/transparency layer, then all you need to do is prefix the output filename with PNG32:. In the Terminal, that looks like this:

magick input.png PNG32:output.png

If you mean something else, please click edit under your question and clarify.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432