It is currently Fri Apr 26, 2024 1:20 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 2:44 am  (#1) 
Offline
GimpChat Member

Joined: Jun 14, 2016
Posts: 5
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Basic Level



Hey,

I want to programmatically edit some very simple predefined SVG or other vector files and then generate PNGs from them. Need just to scale, change some basic colors, and make gradients without touching the shape of the vector image at all.

I wonder which is the best approach. To use SVG or some specific GIMP files... exported shapes?

The antialiasing is important too. The outputted PNGs must be as crisp as possible. When I open an SVG in GIMP under Windows, it applies some very nice antialiasing to the shape, but when I colorpick it, it gets pixelated or the semitransparent pixels are not affected.

As I mentioned above, the process will be running entirely in CLI mode under CentOS.

Any thoughts?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 5:18 am  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13016
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
Hristo Milev wrote:
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Basic Level



Hey,

I want to programmatically edit some very simple predefined SVG
or other vector files and then generate PNGs from them.
Need just to scale,
change some basic colors,
and make gradients without touching the shape of the vector image at all.

I wonder which is the best approach.
To use SVG or some specific GIMP files... exported shapes?

The antialiasing is important too.
The outputted PNGs must be as crisp as possible.
When I open an SVG in GIMP under Windows,
it applies some very nice antialiasing to the shape,
but when I colorpick it,
it gets pixelated or the semitransparent pixels are not affected.

As I mentioned above,
the process will be running entirely in CLI mode under CentOS.

Any thoughts?

You might want to look into using Inkscape,
which is primarily a vector based graphics program.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 5:48 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
ImageMagick's convert command will convert a SVG to PNG, it can be as as simple as:
convert image.svg image.png

For more comple stuff there is very comprehnsive set of options. In general IM is your tool of choice for all CLI/Batch image manipulation.

_________________
Image


Top
 Post subject: Re: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 11:09 am  (#4) 
Offline
GimpChat Member

Joined: Jun 14, 2016
Posts: 5
Now I realized there will be some corner rounding and therefore using SVG is a must. It has easy to edit XML syntax.

I need to get some Linux running on my wreck. My current machine is more than 10 years old, but a German made - top notch and immortal.

Thanks for the answers. About ImageMagick - I decided to use GIMP long time ago. I guess you are used to ImageMagick but it's not a good solution for me. BTW can you edit histograms with ImageMagick?


Top
 Post subject: Re: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 2:17 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Hristo Milev wrote:
Now I realized there will be some corner rounding and therefore using SVG is a must. It has easy to edit XML syntax.

I need to get some Linux running on my wreck. My current machine is more than 10 years old, but a German made - top notch and immortal.

Thanks for the answers. About ImageMagick - I decided to use GIMP long time ago. I guess you are used to ImageMagick but it's not a good solution for me. BTW can you edit histograms with ImageMagick?


I do all my interactive stuff with Gimp. For CLI, IM ends up being easier and more efficient in 99% of the cases (and I'm not that much used to it). You can likely apply curves to your image (if this is what you mean by "edit histogram"). But this is GimpChat, not IMChat, you'll get much more informed answers on the IM forums.

_________________
Image


Top
 Post subject: Re: Generating PNGs from SVG
PostPosted: Sun Aug 21, 2016 10:16 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Hristo Milev wrote:
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Basic Level



Hey,

I want to programmatically edit some very simple predefined SVG or other vector files and then generate PNGs from them. Need just to scale, change some basic colors, and make gradients without touching the shape of the vector image at all.

I wonder which is the best approach. To use SVG or some specific GIMP files... exported shapes?

The antialiasing is important too. The outputted PNGs must be as crisp as possible. When I open an SVG in GIMP under Windows, it applies some very nice antialiasing to the shape, but when I colorpick it, it gets pixelated or the semitransparent pixels are not affected.

As I mentioned above, the process will be running entirely in CLI mode under CentOS.

Any thoughts?


If you were to use a script like this one on Post #41 of this thread
that is called path_to_darken_layer.scm it will make a layer with NO antialiased edges that you can apply color to or gradients. You could just disable the line 8 of the script that turns the layer to darken only mode. It would be an easy way to make non aliased layers, that have the Lock Alpha Channel enabled, and are cropped to layer size. Simply have the path highlighted and use the script from the script fu tab. That's what it sounds like your trying to do I think.


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Online tool for generating Poincare Discs.

4



* Login  



Powered by phpBB3 © phpBB Group