PNG Export - no background option?

Previous topic - Next topic

Gibbz

I have a simple script to export my document as a png. I need access to the "no background" option. But cant find the api information for this.
How can I access this setting?

My script is currently bellow:

import scribus
img = scribus.ImageExport()
document_name = scribus.getDocName()
img.name = document_name.replace(".sla",".png")
img.type = 'PNG'
img.scale = 100
img.quality = 20 # 1-100, 100 = high
img.dpi = 96
# need access to the "no-background" option here for transparency!
img.save()


a.l.e

imo, just export to pdf and convert the pdf to png and taking care of transparencies.

imagemagick or pdf2image (python module) might be of help here...

in the worst case, it seems to be possible to do so with inkscape (which can be called from a python script):

https://stackoverflow.com/questions/46203639/converting-a-pdf-to-a-png-with-alpha-layer-transparency-capable-taking-way-too

imo, exporting to PNG from Scribus is only for preview purposes and having only a basic support is fine for me... as long as there are other ways to achieve the goal...

please keep us updated, if one of the hint above (or any other solution) did work for you...

Gibbz

I figured as much. I only need basic output of png's. But that is on the list of basics :)

Guess I can look at making code changes for this while im at it... Thanks for your help in the other thread btw!

a.l.e

yes, a patch for the scripter is probably welcome and is probably easy to add. the feature exists in scribus.

but i still think that it would have been better to keep scribus a bit simpler and document how to use python to transform a pdf into a png with a transparent background.
imo, scribus has the disposition to do too many things not that well... and i would sometimes prefer it would do slightly less but really well... most of all when there are already workflows for achieving the same result...

Gibbz


a.l.e


a.l.e