Loose opacity but maintain the colors achieved with it?

Post questions on how to use or achieve an effect in Inkscape.
TheMonkeysaur
Posts: 4
Joined: Sun Oct 15, 2017 4:34 am

Loose opacity but maintain the colors achieved with it?

Postby TheMonkeysaur » Sun Oct 15, 2017 4:43 am

Hi,

I am exporting vector graphics for use in game design, and opacity is really useful for shading, but when I export my png I want the shading that I created using opacity in Inkscape, but I don't want the opacity to be maintained with the image I export. I guess Ideally I want to be able to "replace" the opacity with the color/shading achieved using it.

Currently my assets are opaque in my game engine which sometimes is not going to be what I want.

Thanks for any help.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Loose opacity but maintain the colors achieved with it?

Postby Xav » Sun Oct 15, 2017 6:28 pm

The easiest way is simply to add a background object of the same colour that you're using for the canvas background (typically white, but could be something else). Just adding a rectangle will do, but you'll then lose the transparency around the outside of your shape. So what you probably want is a coloured silhouette of your objects which you then drop to the back of the lowest layer (or put on a "background" layer of its own).

There are a few ways to create a silhouette, depending on the complexity of your shapes; if you can get away with it, just selecting all the objects that contribute to the outline, duplicating them and then using Path > Union will often do the job.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Loose opacity but maintain the colors achieved with it?

Postby Moini » Sun Oct 15, 2017 9:46 pm

What I usually do for these cases to achieve only pixels with 100% opacity or 100% transparency is to open the image in gimp, put a white layer below, merge the layers into one, then use the wand tool with a threshold of 0 to select all exactly white areas (there may exist a better way), then hit Del to remove.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Loose opacity but maintain the colors achieved with it?

Postby tylerdurden » Mon Oct 16, 2017 12:59 am

Sorta begs the question, do you want overlapping objects to have the third color..

If not, maybe for a few items:

Image

Not gonna work easily for gradients, tho.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

TheMonkeysaur
Posts: 4
Joined: Sun Oct 15, 2017 4:34 am

Re: Loose opacity but maintain the colors achieved with it?

Postby TheMonkeysaur » Mon Oct 16, 2017 3:55 am

Thanks for the suggestions! I'll give these a shot!

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Loose opacity but maintain the colors achieved with it?

Postby brynn » Mon Oct 16, 2017 4:59 pm

I can think of a way to use the Dropper tool to "fix" a gradient. Not precise, but if close enough it ok, it could work.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Loose opacity but maintain the colors achieved with it?

Postby Moini » Mon Oct 16, 2017 10:05 pm

I'd have suggested that, too, but if the user uses blur, it's not going to work :-(
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”