.py .inx sample in regards to sending a object to a ....

Discussion about writing code for Inkscape.
ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

.py .inx sample in regards to sending a object to a ....

Postby ShawnWDion » Wed Jan 25, 2017 4:06 am

I'm looking for a sample code that can send a object (Raster or Vector part) submit it to a program such as imagemagick (or other don't care I'm just trying to figure it out) and re-import that object into the location of the old one.

or even a github project I'm trying to figure out for some crazy tools I found that are command base but the result file is compatible with inkscape.

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

Re: .py .inx sample in regards to sending a object to a ....

Postby Moini » Thu Jan 26, 2017 9:31 am

So what you need is:

- get the current selection (almost all extensions do that)
- if you want to use the vector data, you need to turn it into a real vector file, for the next software to work with it.
- if you want to use vector data converted to raster, you need to export that part, using the inkscape command line from inside the extension, see for example the linked extension below
- then you will call an outside program (there are many extensions that do that, e.g. https://github.com/giacmir/Inkscape-JPE ... -extension calls imagemagick) on the exported file, or maybe just with some data bits you get directly from Inkscape, depending on what the outside program can digest.
- then replace the selection by something different (all modify path extensions do that)
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)

ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

Re: .py .inx sample in regards to sending a object to a ....

Postby ShawnWDion » Thu Jan 26, 2017 10:34 am

Once again thanks for the help

It was in the modify extension the part of code I was looking for.

As always I have no issues with sharing my craziness check this out, I think it was Lazur that was experimenting with halftones here's a cute tool I found that well I just had to incorporate in inkscape

http://www.saliences.com/projects/npr/s ... index.html

I'd love to see a sticky post of all the tools that can generate svg or vector files to compliment inkscape.

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

Re: .py .inx sample in regards to sending a object to a ....

Postby brynn » Thu Jan 26, 2017 11:06 am

Do you mean that you wrote an extension for Inkscape, that will do that stippling? If so, where is it? Can you upload to the website? (https://inkscape.org/en/gallery/=extension/)

All the tools that can generate files that compliment Inkscape? Like for example?

ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

Re: .py .inx sample in regards to sending a object to a ....

Postby ShawnWDion » Thu Jan 26, 2017 11:53 am

Zebratrace (http://maxim-s-barabash.github.io/ZebraTrace/)... is another great example of a tool of some of the things I saw manually generated here... as for the extension to make what you saw for stippling to inkscape that's what I'm working on to get done as I know it's something that people will want and with the information moini gave me I should be on the right track to get this done as I love playing with outside gadgets and boy do I have 100's of them but if I can interact in inkscape directly and avoid the middleman I'll definitely do it.

Also here's another great tool http://wiki.evilmadscientist.com/StippleGen same people who made the eggbot extension that splits colors to layers. I have the bookmark somewhere where they have a python script that does the same thing that would probably not be a lot of work to embed into a working inkscape extension.

Another quick search of a online version (That you can download and run locally) http://www.svgeneration.com/

click on the 3x3 right top square there are all the different online svg generators posted there to name a few.

But ya on a final note I even signed up for some programming courses related to code language converting so what better than open source codes that generate great results and implement in another open source project.. heck if it wasn't for the potrace project the biggest part of inkscape that I use would of never existed in it's form.

I'll gladly donate this extension to the project once I'm done I'll even open a github page for people to test it out along the way.

For 2017 I gave myself a new years resolution to give back more to the open source community projects.

ShawnWDion

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: .py .inx sample in regards to sending a object to a ....

Postby Lazur » Thu Jan 26, 2017 12:09 pm

Re zebratrace-
it is possible reproducing any kind of hatching alike zebratrace by filtering.
Here is an example, even made a "demo video" from it recently.

Here is the base svg containing the filter.

ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

Re: .py .inx sample in regards to sending a object to a ....

Postby ShawnWDion » Thu Jan 26, 2017 12:45 pm

@Lazur

I know I noticed your work I was mentioning ZebraTrace as example tools that generated SVG's on their own, I personally prefer your hand made work than a PC generated model as yours gives it a much more natural flair to your results.

Zebratrace does what it does however unless you know how to create formulas to suit your needs, obviously your method is WAY quicker and gets the job done.

I started messing around in finding tools like this when I saw a post on hack a day in regards to CNC "CREATING HALFTONE PICTURES WITH A CNC MACHINE" using archive.org (http://web.archive.org/web/201601081300 ... ex_en.html) I was able to get the version of the softwares that generated the images I wanted but without something worthwhile to play with I started searching more and more for new ways to do things and I figured out that inkscape was the perfect platform for experimentation.

Heck I for one respect your work and determination in my case I just have a habit of pushing software's to their extremes, who knows might be a interesting YouTube channel to make with out of the box ways to use programs beyond their normal purpose.

P.S: The reason why I love the stippling I mentioned is that I replace the colors in the circles with a small number and print them out, fun to color and if you do a decent job at filling the circles you get your image result a bit like those adult coloring books but for people with more patience.

Best Regards

ShawnWDion

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

Re: .py .inx sample in regards to sending a object to a ....

Postby brynn » Thu Jan 26, 2017 1:01 pm

ShawnWDion, I think you are thinking more on the level of a developer. So I don't understand the benefit of putting these other programs and tools in a sticky topic. But if others think it would be helpful, and you and/or others can create the list, I'm sure it would be a nice resource. Maybe sticky topic in Resources board?

Or would it be more useful on the website? Or both?

ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

Re: .py .inx sample in regards to sending a object to a ....

Postby ShawnWDion » Thu Jan 26, 2017 1:56 pm

Inkscape Resources.. lol seriously I need glasses I'll place them in that section and share what I've found around the web with ways to use them.

I'm so used to using the main categories that section completely was a blind spot on my part. No section required that will do nicely.

ShawnWDion


Return to “Programming”