[extension] Bitmap export

Post questions on how to use or achieve an effect in Inkscape.
carto.metro
Posts: 2
Joined: Sun Feb 20, 2011 10:17 pm

[extension] Bitmap export

Postby carto.metro » Sun Feb 20, 2011 10:40 pm

Hello,

I would like to write an extension and I can't find enought documentation.
Here is want I want to do:
- Export a part of the current document in PNG (just as the menu file>bitmap export) in sequence (to cut an image in mozaic)

It's possible to do it with the command line option " --export-area " but using the command line (Popen/os.popen3) is very slow because it launch a subprocess.
My question : is it possible to use the embed bitmap export function from an extension ?

Thanks in advance !

User avatar
prokoudine
Posts: 186
Joined: Sat Jun 09, 2007 4:32 am
Contact:

Re: [extension] Bitmap export

Postby prokoudine » Mon Feb 21, 2011 10:26 am

I'm not quite sure it's possible in 0.48. The next version, however, to the best of my knowledge, will feature D-Bus scripting that exposes a lot of Inkscape's internals, so you would be able to just use regular Inkscape features from scripts.
http://libregraphicsworld.org — news and tutorials on free design software

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [extension] Bitmap export

Postby ~suv » Mon Feb 21, 2011 5:41 pm

carto.metro wrote:- Export a part of the current document in PNG (just as the menu file>bitmap export) in sequence (to cut an image in mozaic)
Why don't you use existing tools?

carto.metro wrote:My question : is it possible to use the embed bitmap export function from an extension ?
No, script-based extensions do not have access to internal functions. You can write a C++ extension (aka plugin) like 'Extensions > Render > Grid…' which afaiu could call internal functions, but in this case you need to recompile Inkscape to test and use your extension.

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

Re: [extension] Bitmap export

Postby brynn » Mon Feb 21, 2011 7:05 pm

I would like to write an extension and I can't find enought documentation.

The info you've received from prokoudine and ~suv is probably better than anything I can offer. But we've had several requests in these forums recently, for info on writing Inkscape extensions. I've been referring them to the bottom part of this page: http://wiki.inkscape.org/wiki/index.php/Inkscape

carto.metro
Posts: 2
Joined: Sun Feb 20, 2011 10:17 pm

Re: [extension] Bitmap export

Postby carto.metro » Tue Feb 22, 2011 5:11 am

prokoudine wrote:I'm not quite sure it's possible in 0.48. The next version, however, to the best of my knowledge, will feature D-Bus scripting that exposes a lot of Inkscape's internals, so you would be able to just use regular Inkscape features from scripts.
Thanks a lot, this is very interesting, I'll look at the trunk version, do you know if the feature is already available ?... (using the a dev version just for exports is not a big risk ! ;-)

~suv wrote:Why don't you use existing tools?

batch > require a set of hidden rectangle, fastidious thing, and I want to export with multiple dpi > I'll have to make a set of matrix ? it becomes to be really unusable in my case... (and I want to labelize specifically each slice...). For information : for some images I generate something more than 11000 slices for very high resolution... (using a PNG export and a GIMP scheme script to slice...)
slicer-extension > use a subprocess, so it's slow..
inkscape-guillotine> same a above (maybe much more efficient in 0.49 if it's integrated..)

~suv wrote:
carto.metro wrote:My question : is it possible to use the embed bitmap export function from an extension ?
No, script-based extensions do not have access to internal functions. You can write a C++ extension (aka plugin) like 'Extensions > Render > Grid…' which afaiu could call internal functions, but in this case you need to recompile Inkscape to test and use your extension.
Ok, but writting in python (or an other script language) is much simpler :-D (but generally slower too, I know... :-( )

brynn wrote:[...]we've had several requests in these forums recently, for info on writing Inkscape extensions.
I was looking for something which doesn't exist.. so it's normal that I can't find anything about ! But I approve all efforts on documentation for extensions :) Maybe for the 0.49 and all the new features included !


Return to “Help with using Inkscape”