Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 09 Dec 2018, 20:02
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
LibreOffice Draw converts raster (png, jpg) to vector svg?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
mikeslr


Joined: 16 Jun 2008
Posts: 2833
Location: 500 seconds from Sol

PostPosted: Sun 24 Dec 2017, 12:22    Post subject:  LibreOffice Draw converts raster (png, jpg) to vector svg?  

I wanted to convert one png image to svg. Neither mtpaint nor gimp could do it. I tried various online converters. One did a poor job. The rest wanted to sell me something. Found an online tutorial-video on how to do it using Inkscape: many steps involved and requires the full Inkscape. Sad

So in desperation --figuring it was a waste of time-- I opened Libreoffice Draw. Imported the png. Exported the svg. Done. Very Happy

mikesLr
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1117

PostPosted: Mon 25 Dec 2017, 03:36    Post subject:  

Did Draw trace the image and actually convert lines and shapes into vectors, or did it embed the bitmap into an svg envelope? In the latter case scaling up the svg image will show pixelation just as badly as with a png image. And svg file size will be larger than the source png file size.
_________________
Fatdog64-800|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2833
Location: 500 seconds from Sol

PostPosted: Mon 25 Dec 2017, 09:48    Post subject:  

Hi step,

I don't know enough to be able to answer your question. And I've misplaced the original svg that was created. So I've done another, starting with a png with a reasonable amount of detail and have attached both the original and the resulting svg. As svg isn't one of the extensions supported by the Forum, I've added a false ".gz" ending to it. Let us know what you find out.

Thanks,

mikesLr
camera3.svg.gz
Description  LibreDraw Converted to svg -- Remove false '.gz'
gz

 Download 
Filename  camera3.svg.gz 
Filesize  106.5 KB 
Downloaded  70 Time(s) 
camera3.png
 Description   Original png
 Filesize   76.2 KB
 Viewed   140 Time(s)

camera3.png

Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 118

PostPosted: Mon 25 Dec 2017, 10:32    Post subject:  

106.5 KB vs. 76.2 KB ! No vector graphic here.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2833
Location: 500 seconds from Sol

PostPosted: Mon 25 Dec 2017, 12:10    Post subject:  

phat7 wrote:
106.5 KB vs. 76.2 KB ! No vector graphic here.


Are you sure?

I just opened the file with the svg ending (after removing the false .gz) in inkscape lite. That application, which could see pngs and jpgs, couldn't open them.

Regarding the comparative file size difference between svgs and pngs, as far as I can tell, there is no absolute 'rule of thumb'. Rather, "When the number of paths / anchor points [of a vector graph] increase, the mathematical information to store them also increases! In these cases a bitmapped version of the file can be more suited for a lesser file size." https://graphicdesign.stackexchange.com/questions/61624/svg-file-size-more-than-a-png-image. In other words, the size will depend on the amount of information to be presented. In order to evaluate the extent to which using Libre-Draw results in pixelation, I purposefully chose a graphic with a lot of detail.

mikesLr
Back to top
View user's profile Send private message 
mostly_lurking

Joined: 25 Jun 2014
Posts: 284

PostPosted: Mon 25 Dec 2017, 13:27    Post subject:  

I opened the SVG in Inkscape Lite and zoomed in - it was pixelated; I also opened it in Geany (an SVG is actually an XML text file), which showed the embedded PNG image data. It's definitely still a PNG image.

Besides - a tracing tool like the one in Inkscape won't give you an SVG representation of your picture, it will look more like a black-and-white photocopy made out of vector curves, which can be used as a base to manually redraw the image as vector graphic in Inkscape.

https://inkscape.org/en/doc/tracing/tutorial-tracing.html

Inkscape Tutorial wrote:
Keep in mind that the Tracer's purpose is not to reproduce an exact duplicate of the original image; nor is it intended to produce a final product. No autotracer can do that. What it does is give you a set of curves which you can use as a resource for your drawing.

Potrace interprets a black and white bitmap, and produces a set of curves.[...]
camera-img.png
 Description   
 Filesize   124.82 KB
 Viewed   109 Time(s)

camera-img.png

Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 118

PostPosted: Mon 25 Dec 2017, 20:12    Post subject:  

Don't expect miracles.
screenshot.jpg
 Description   
 Filesize   10.35 KB
 Viewed   70 Time(s)

screenshot.jpg

camera3.svg.gz
Description  PNG traced with Inkscape (default settings) -- Remove false '.gz'
gz

 Download 
Filename  camera3.svg.gz 
Filesize  39.35 KB 
Downloaded  79 Time(s) 
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 1070
Location: Oslo, Norway

PostPosted: Mon 25 Dec 2017, 23:27    Post subject:  

A second possibility:
I made .png screenshots of the different windows with the dialog below.
1) Drag and drop a .png to Dia
2) Save it as .dia
3) Export the .dia to more than 30 file formats.
4) Open the .svg in mtpaint
5) Expect some bluriness
demo-1.png
 Description   
 Filesize   37.93 KB
 Viewed   62 Time(s)

demo-1.png

demo-2.dia.png
Description 
png

 Download 
Filename  demo-2.dia.png 
Filesize  60.15 KB 
Downloaded  90 Time(s) 

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3186
Location: The Blue Marble

PostPosted: Mon 25 Dec 2017, 23:40    Post subject:  

I think mikeslr only need to re-format the PNG as SVG. It doesn't matter if the SVG is actually vector graphics or not ... as long as the format is SVG. And in that sense, mike has done the correct thing and accomplish what he needs to do.

As for really converting bitmaps to vectors, there are many tools (apart from actually stenciling the image by hand). This is one of them: http://autotrace.sourceforge.net/.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 1070
Location: Oslo, Norway

PostPosted: Mon 25 Dec 2017, 23:43    Post subject:  

And besides, I never manage to upload the correct sequence of the more than 2 images... Confused
_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0950s ][ Queries: 13 (0.0175s) ][ GZIP on ]