Page 1 of 1

Exporting image from Draw with transparent background

PostPosted: Sat Jan 07, 2012 2:22 pm
by cadu
Hello,
I exported image from Draw to PNG format (which supports transparency).
I couldn't find any options in Draw to export with transparency (without the white background).
When I tried to use the images, they were with the background unfortunately. And I need to insert the image over other image (like a montage) and transparency is fundamental.
May anyone tell me whether Draw is able to export image with transparency? How to do it?
Thanks in advance,
Cadu

Re: Exporting image from Draw with transparent background

PostPosted: Sat Jan 07, 2012 6:53 pm
by acknak
Sorry, it's not possible. I don't know of any workaround for it. You always get the page background behind exported images.

If you want to work in a vector drawing application but export the result as an image, you should use Inkscape (http://www.inkscape.org): it's far more capable and has first-class image export.

Re: Exporting image from Draw with transparent background

PostPosted: Sun Jan 08, 2012 3:39 am
by cadu
Hello,
If "PNG with transparency" was possible a plenty of image usage could be attached to draw...
Following your tip I am exporting from Draw as WMF or SVG and finishing the work in Inkscape. What a pity! Otherwise Draw would be sufficient to my needs.
Do you know when Draw apply 3d-look to charts the shapes become raster instead vector? It is because I could ungroup in Inkscape or even "break" in Draw just the plan charts...
Ps.: Is there any way of suggest it to team developers? I think this is a little feature that could improve a lot images outputs of Draw. I was hoping a little bit more of Draw on it. It seems to me that is impossible inside OOo suite to create a simple logo with transparency to apply in documents with colorful background...
Best,
Cadu

Re: Exporting image from Draw with transparent background

PostPosted: Sun Jan 08, 2012 5:20 am
by acknak
See [Tutorial] Reporting bugs or suggestions

However, I'm almost certain that this has already been brought up. As you say, it's a rather critical limitation.

It seems to me that is impossible inside OOo suite to create a simple logo with transparency to apply in documents with colorful background.

Yes, you are correct; that is not possible with OOo.

However, it is also not needed: you can create the logo as a vector graphic and copy/paste that without any background. There's no need to convert the vector logo to an image if you're going to use it in an OOo document.

Re: Exporting image from Draw with transparent background

PostPosted: Sun Jan 08, 2012 5:35 pm
by cadu
Thanks for your attention Acknak!!!

Re: Exporting image from Draw with transparent background

PostPosted: Fri Jan 13, 2012 12:04 pm
by keme
There is a workaround for making the png background transparent:
  • Select your object(s) and export to png (tick "selection"!) as you normally would.
  • Insert the exported image into Draw.
  • Use the eyedropper to make the image background transparent. (If you have white areas that should not be transparent, you need to use some "greenscreen" colour for the background of your original drawing)
  • Save as image.
Alas, it seems that Draw won't keep transparency when exporting objects, so there's no way to maintain partial transparency on your drawing objects, even though the png format itself supports an "alpha channel" which should allow this.

Re: Exporting image from Draw with transparent background

PostPosted: Fri Jan 13, 2012 4:50 pm
by acknak
Nice!

Yes, that's the only workaround I'm aware of, and depending on the graphic, it may work well.

But if you're starting out to make such an image, it's better not to use Draw at all. There are a number of issues with using Draw for this, and for some (maybe most) cases, the workaround will still leave discolored edges due to antialiasing. You have to use the alpha channel to get it right.

Inkscape gives a really nice result for this sort of work.

Re: Exporting image from Draw with transparent background

PostPosted: Sat May 26, 2012 4:18 pm
by alg
For AOO 3.4 I have extended the conversion to bitmap to create no longer the white background but the needed alpha channel (also improved quality in the current trunk, unfortunately not in the release version). I have no 3.4 at hand right now, but since that conversion is the base for exporting selected graphics to pixel formats (as png) you may try to export to png in AOO 3.4, it may be possible now. I'll check ASAP, too. HTH!

Re: Exporting image from Draw with transparent background

PostPosted: Sat May 26, 2012 9:43 pm
by acknak
Great news! That will be a really nice improvement. Thanks!

For me, AOO 3.4 still exports a white background with the selected object; I'll keep looking for it in newer releases.

Re: Exporting image from Draw with transparent background

PostPosted: Sun May 27, 2012 1:13 pm
by alg
Hi acknak, thanks for checking. At least the conversion to bitmap should be better now (in 3.4). Do we have a task on bugzilla for this that I can set to something more current and to keep an eye on it?

Re: Exporting image from Draw with transparent background

PostPosted: Wed May 30, 2012 1:19 pm
by alg
Hi acknak,

just checked wit an AOO3.4. Exporting directly (e.g. ellipse) does not yet create transparencies, but as a workaround every object can now be first converted to bitmap (context menu) and when exporting this (to a format supporting transparencies, e.g. png) you get the transparent graphic in good quality.

I will check where the conversion happens internally for direct export to automate his AFAP...
HTH for the moment!

Re: Exporting image from Draw with transparent background

PostPosted: Wed May 30, 2012 3:28 pm
by acknak
Sounds like a good workaround. I noticed the Convert > To bitmap function but I failed to make the connection.

Re: Exporting image from Draw with transparent background

PostPosted: Wed May 30, 2012 5:16 pm
by alg
Hi acknak,

I have checked the code. It is possible with AOO3.4 to export the selection as GIF (without converting to bitmap before). In the GIF feature dialog transparency is available and works. Disadvantage is that in GIF only a mask (1bit) is possible, thus gradient transparencies of objects will get lost and the edges will not be too nice anti-aliased.

Despite that the quality can be improved and a transparency feature is obviously missing in PNG export and it's feature dialog. I wrote #119601# for it and already found the relevant places. Thus, the next major release will allow export without the trick to first convert to bitmap via context menu.

HTH!

Re: Exporting image from Draw with transparent background

PostPosted: Wed May 30, 2012 8:27 pm
by acknak
Good write-up--thanks!

Re: Exporting image from Draw with transparent background

PostPosted: Fri Aug 12, 2016 12:37 pm
by emiliano1954
I found a workaround to have transparent background from LibreOffice Draw.
1. Export a PNG image with white background as usual.
2. Load the image into lunapic.com
3. Edit > Transparent.
4. Click on a white area.
5. Save the image with transparent background.

Is simple and useful for me.