Follow

Help with possible scripted solution for art admin 

I'm on Linux. I make free colouring pages. My workflow is, draw black line art mandala in Krita, save as PNG, load in Inkscape, trace bitmap (vectorising the lines), rescale, export to PNG, place the art on an A4 page template which has my URL on the bottom, export as PDF.

Is it possible to script this process?

(I will always draw in Krita at a size that needs upscaling, please don't suggest a different approach to that part).

· · Web · 9 · 11 · 3

Help with possible scripted solution for art admin 

@welshpixie The short answer is very probably, yes for most of that. The part where you put the art into another document I am not sure about. ImageMagick can probably do all of the rest though. imagemagick.org/index.php

Help with possible scripted solution for art admin 

@hamishtpb Well, the purpose of that is just to get it onto an A4 page (so that it's in a print-ready size) that also has my URL on it (people share their coloured art online, so having my URL on there helps people to find me, and helps the people posting to remember where they got the page) - so as long as it does that, in some way/shape/form, it's fine :D

Help with possible scripted solution for art admin 

@welshpixie There are tons of examples on the IM website that should help you to shape a script that does almost all of the tasks for you. I hope that is of some help. The other thing that popped straight into my head (since you are using Krita) was "is there a way to use Kross scripting?" but I really haven't ever looked into that much. (Kross is a KDE scripting thing.)

Help with possible scripted solution for art admin 

@hamishtpb Doesn't look like imagemagic does tracing to vector, but I found a thread from someone asking for the same thing that mentions potrace, and someone else on here mentioned potrace, so I'll check that out too ^.^

Help with possible scripted solution for art admin 

@welshpixie

You can add the A4 template and the URL and export as PDF directly from Inkscape, no need of an intermediate PNG.

Take a loot at Potrace (the conversion engine used by Inkscape, but the stand alone version is faster) to convert PNG to SVG in a scriptable way.

potrace.sourceforge.net/

Help with possible scripted solution for art admin 

@GustavinoBevilacqua I have the potrace page open right now :D :D

Help with possible scripted solution for art admin 

@welshpixie

The most important thing is to think of it as PO-trace, not as pot-race 😄

Help with possible scripted solution for art admin 

@GustavinoBevilacqua No! Forever pot race ;p

Help with possible scripted solution for art admin 

@GustavinoBevilacqua Ok, got the entire process in inkscape now (there was a reason I didn't make the pdf in inkscape previously but I haven't tried doing it in inkscape for a while - possibly some feature that it didn't previously have that now it does). Now if only inkscape had macros XD (I know it has some kind of scripting and extensions, looking into that now)

Help with possible scripted solution for art admin 

@welshpixie IIRC, Inkscape uses Potrace (a CLI program) for its bitmap tracing, so that + ImageMagick + (something else for PDF? idk) would probably work

Help with possible scripted solution for art admin 

@welshpixie A quick search brings up potrace to trace bitmap line art to SVG. It can write to PDF, so perhaps with the right arguments the upscaling to A4 can all happen in one go. You can also use ImageMagick, another command-line tool, to scale bitmaps and composite your URL onto the page (or your artwork onto a template), etc.

Help with possible scripted solution for art admin 

@welshpixie the only thing I can think of it make an inkscape template for the A4 page so you skip that step and just import the png and vector it on the template page and export it as it will print to whatever format

Help with possible scripted solution for art admin 

@efi Yeah - there was some reason I didn't export to pdf through Inkscape previously but it seems to be fine now, I just tried it, so that at least helps cut down the steps involved :D

Help with possible scripted solution for art admin 

@welshpixie As far as I know, yes except for the tracing. If you can use color_trace, potrace, or autotrace, I think you can automated it all.

Help with possible scripted solution for art admin 

@dmoonfire apparently inkscape uses potrace, so yes ^.^

Help with possible scripted solution for art admin 

@welshpixie Inkscape actually passes out to a different program for vectorization. I think the options are Potrace and Autotrace?

Help with possible scripted solution for art admin 

@welshpixie If you need help with rsvg-convert, or to embed an SVG inside another one (say, the traced image inside an SVG with just the text), feel free to poke me. I'm not sure if you found a way to do the whole process in Inkscape, or if you need to tweak the traced image at all.

Help with possible scripted solution for art admin 

@federicomena Thank you! @fabrixxm actually made a script for me that does everything I need :D

Help with possible scripted solution for art admin 

@welshpixie not sure if this helps but inkscape has cmdline features and imagemagick can transform / export to PDF

Help with possible scripted solution for art admin 

@miccaman Ah some fantastic person made a script for me that I can run that does the whole thing so I'm sorted now :D :D

Sign in to participate in the conversation
Mastodon.ART

Mastodon.ART — Your friendly creative home on the Fediverse! Interact with friends and discover new ones, all on a platform that is community-owned and ad-free. Admin: @Curator. Currently active moderators: @ScribbleAddict, @TapiocaPearl, @Otherbuttons, @Eyeling, @ljwrites