1

EDIT: Hello, yes, I am trying to get transparent icons on a solid white background. Also, the second link is not broken. It needs html code to display it correctly. Here is a screen shot of what it does when I change background color using html. I can get it using Pixlr, but the image quality suffers.

[transparent icons with solid background


I have looked high and low but everything online deals with a transparent background. I have managed to do that using Inkscape, but what I need is a solid white background with an alpha image.

PNG with a transparent alpha background

I have also managed to make the image itself transparent with a solid background using Pixlr. But, the quality is just horrible. Can I achieve the below using Inkscape or similar without compromising on image sharpness?

PNG with transparent background

PNG with transparent icon

The second will show up as blank image unless it is embedded with background color in html.

6
  • Welcome to Graphic Design SE. Unfortunately, I am not sure that I understand what exactly you want to achieve and what your problem is. Do you want black icons on a transparent background (your first example) or transparent icons on a white background? Please edit your question to clarify what you need (and fix that broken image link).
    – Wrzlprmft
    Commented Jan 13, 2016 at 14:51
  • Probably you want to invert the alpha channel in your image? Commented Jan 13, 2016 at 15:21
  • That is what I did using Pixlr. But I can't seem to do the same in Inkscape?
    – kFMIF
    Commented Jan 13, 2016 at 15:35
  • I'm also not clear what you are actually trying to accomplish. What part are you struggling with?
    – DA01
    Commented Jan 14, 2016 at 18:19
  • @DA01 yes, I know it's a odd requirement. the aim here is to use one png file with a few icons as src for img tag in my html code. when I change the background color only the icons should change color as seen in the screenshots above. Sorry to repeat myself; I am able to do this in pixlr (bad quality) but not in inkscape.
    – kFMIF
    Commented Jan 15, 2016 at 12:53

2 Answers 2

2

So you are drawing your icons in Inkscape? Try this:

  • If you are using lines of some width, use the "Path > Stroke to path" command to convert them into filled paths without a stroke.
  • If you are using text, use the "Object > Ungroup" command to convert each text object into individual filled paths.
  • If you are using filled paths, leave them unchanged but check that they don't have a stroke.
  • Select all resulting paths.
  • Use the "Path > Union" command to merge them into one filled path.
  • Draw a rectangle of the desired icon's size over the merged path.
  • Select both the rectangle and the merged path.
  • Use the "Path > Exclusion" command to subtract the path from the rectangle.
  • Adjust the color of the resulting object.
  • Export to PNG.
2
  • I've already tried this Goblin. No dice. Also, the original icons were designed in AI, just so you know. I do import .ai and use the export to png option.
    – kFMIF
    Commented Jan 15, 2016 at 12:50
  • @kFMIF, what's the result? I think any vector graphics imported to Inkscape can be ungrouped and converted to paths. Commented Jan 15, 2016 at 13:10
0

Another option. I don't know Pixlr, but since you are able to save PNG with alpha, it appears to be a decent image editor.

  • Export the icon from AI or Inkscape to PNG, as you have done previously, but with a very large image size (e.g. 10 times larger than needed)
  • Open it in Pixlr, add solid background and make the coloured areas transparent
  • Resize (resample) the image to the required size (use the best quality settings)

Hopefully the alpha channel gets smoothed during resize and you will get the required good image quality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.