A few weeks ago, at the suggestion of one of our fine users, I added a Potrace image-to-vector tracing engine to Inkscape. Initially, it just traced the image according to a hardcoded brightness threshold. Later I added a threshold adjustment.
Today, there is a new toy, "Canny Edge Detection", also sometimes called "optimal edge detection." This should help with the tracing of more subtly colored images, and not just by simple brightness. Check it out:
http://troi.hous.es3.titan.com/~rjamison/inkscape/files/potrace.png
Play with it, break it, etc. Have fun.
BTW: Here is the kind of image that 'pov-out' export can make. Our lovely logo, Simpson's-3D style:
http://troi.hous.es3.titan.com/~rjamison/inkscape/files/ispov.png
Bob
BTW: Here is the kind of image that 'pov-out' export can make. Our lovely logo, Simpson's-3D style:
http://troi.hous.es3.titan.com/~rjamison/inkscape/files/ispov.png
I was just looking for an excuse to mention Verse, which I hope is of general interest and you haven't all already heard about but 3D is usually a little offtopic. Verse is a system for tying other applications in to Blender. It would be cool if someone hooked up blender similar to the you have hooked up POV-Ray. http://www.blender.org/modules/verse/
There is a plugin that integrates gimp into the blender toolchain that might server as a basis for an inkscape plugin to blender http://users.pandora.be/blendix/verse/old/demo.html
- Alan
Play with it, break it, etc. Have fun.
I tried it on this image:
http://images.google.com/images?q=tbn:cJmhzXleo1MJ:www.softlink.com.au/image...
It's small but Inkscape froze trying to "cannily" trace it (95% CPU and no screen update for at least several minutes until I killed it). Regular threshold trace worked OK, but it looks very blocky.
By the way, in general I find that inkscape/potrace output is quite blocky: it uses many small straight lines instead of a few curves. Moreover the size of these straight line fragments seems to be constant, so for small images (tens of pixels across) it's too bad to be even recognizable. This is very different from the examples that I see at http://potrace.sourceforge.net/. For example import the bitmap of the cartoon head from the front page of that site and trace it in Inkscape. Both methods give ugly blocky results, very unlike the one shown on the site. Perhaps we're setting some default options wrong.
bulia byak wrote:
It's small but Inkscape froze trying to "cannily" trace it (95% CPU and no screen update for at least several minutes until I killed it). Regular threshold trace worked OK, but it looks very blocky.
By the way, in general I find that inkscape/potrace output is quite blocky: it uses many small straight lines instead of a few curves. Moreover the size of these straight line fragments seems to be constant, so for small images (tens of pixels across) it's too bad to be even recognizable. This is very different from the examples that I see at http://potrace.sourceforge.net/. For example import the bitmap of the cartoon head from the front page of that site and trace it in Inkscape. Both methods give ugly blocky results, very unlike the one shown on the site. Perhaps we're setting some default options wrong.
Yes, definitely, there are some settings that I need to expose in the dialog.
In the meantime, try running 'Simplify' on the path a few times after the trace is done. Works quite well.
Bob
Yes, definitely, there are some settings that I need to expose in the dialog.
It's not as much a matter of exposing them as it is the matter of choosing good defaults. If by default it will produce the same results as shown on the potrace site, I will say that the current threshold and mode options are probably quite sufficient.
In the meantime, try running 'Simplify' on the path a few times after the trace is done. Works quite well.
Sure, this is what I use. But it loses a lot of detail before it becomes smooth enough.
bulia byak wrote:
It's not as much a matter of exposing them as it is the matter of choosing good defaults. If by default it will produce the same results as shown on the potrace site, I will say that the current threshold and mode options are probably quite sufficient.
This worked nicely. I copied the default-setting code from the main() in the command-line version of potrace, to the c++ wrapper. Now it traces beautifully.
Bob
Bob Jamison wrote:
This worked nicely. I copied the default-setting code from the main() in the command-line version of potrace, to the c++ wrapper. Now it traces beautifully.
Well, maybe 'beautifully' is overkill, but it has improved noticeably. Here is a win-build with that stuff in it:
http://troi.hous.es3.titan.com/~rjamison/inkscape/builds/Inkscape0409160735....
I'll look into it further, to see how I can improve it.
Bob
On Wed, 15 Sep 2004 21:08:18 -0300, bulia byak <buliabyak@...400...> wrote:
Inkscape. Both methods give ugly blocky results, very unlike the one shown on the site. Perhaps we're setting some default options wrong.
Or maybe there's an error in importing potrace output, which results in curves becoming straight lines.
And by the way there's at least one other error in this: fill rule. If you trace that cartoon head from the potrace site, his eyes come out solid black. But it's not a wrong threshold; there are curves and nodes in his eyes, they just don't show as holes as they should.
Here's the direct link to the source image:
OK. I think I'm getting there. I could not duplicate my spectacular text crash of a few days ago. Everything is working well at the moment.
However, while looking at Unicode mode I have come across a problem. How do I enter these Unicode hex digits which have letters in them?
For example inputting numbers like 2022, 0161, 0026 in Inkscape is straightforward and gives the correct characters. But how do I input 002A, 20AC or 00DD etc? I know the answer must be simple but what is it?
Putting 002A in as a unicode number brings up the symble A since Inkscape reverts to text mode when I input the A. The correct character for 002A is an asterisk
A related question is on ANSI mode. Most of my text software will output a character map with character versus ANSI value. Can I put these ANSI values into Inkscape to get the correct characters? If so, How?
vellum win2k
For example inputting numbers like 2022, 0161, 0026 in Inkscape is straightforward and gives the correct characters. But how do I input 002A, 20AC or 00DD etc? I know the answer must be simple but what is it?
Putting 002A in as a unicode number brings up the symble A since Inkscape reverts to text mode when I input the A. The correct character for 002A is an asterisk
Works for me:
Ctrl+U 0 0 2 a Esc
produces an asterisk. What do you use? Does that work for you?
A related question is on ANSI mode. Most of my text software will output a character map with character versus ANSI value. Can I put these ANSI values into Inkscape to get the correct characters? If so, How?
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
I knew it was simple!!!
vellum wrote:
Putting 002A in as a unicode number brings up the symble A since
Inkscape
reverts to text mode when I input the A. The correct character for 002A
is
an asterisk
bulia wrote:
Works for me:
Ctrl+U 0 0 2 a Esc
produces an asterisk. What do you use? Does that work for you?
When I put in Ctrl+U 002a it works. When I put in Ctrl+U 002A it does not-it produces an A. The unimode hex values that I have come across all use upper case letters A, B etc. Why does Inkscape use lower case? Can we change it? or document it?
vellum wrote
A related question is on ANSI mode. Most of my text software will output
a
character map with character versus ANSI value. Can I put these ANSI
values
into Inkscape to get the correct characters? If so, How?
bulia wrote>
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
Yes, ANSI is a subset of Unicode.
vellum
When I put in Ctrl+U 002a it works. When I put in Ctrl+U 002A it does not-it produces an A. The unimode hex values that I have come across all use upper case letters A, B etc. Why does Inkscape use lower case? Can we change it? or document it?
Hmm, it's a bug. Of course hex numbers are case-insensitive and must work with both. I now fixed that in CVS. Thanks for catching it.
vellum wrote:
bulia wrote>
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
Yes, ANSI is a subset of Unicode.
Actually, it's not.
ASCII is a subset of Unicode, but ANSI is a term that Microsoft "borrowed".
They adopted a scheme that never made it out of proposal for their character-set codepages. In general, it's 8-bit or multi-byte character set used by Microsoft. CP-1252 (Windows Western) is one "ANSI Code Page". CP-932 is another.
ASCII is a subset of Unicode. Latin-1 (ISO-8859-1) is also a subset of Unicode. ASCII is a subset of Latin-1. Cp-1252 is not a subset of Unicode (characters from $80 through $9f differ).
Usually (note that I said usually) most ANSI encodings will be a superset of ASCII, so most ASCII values will work.
(ASCII is 7-bit only, with values from 0 through 127)
My advice on all this mess: stick to Unicode and forget about anything else :)
On Thu, 16 Sep 2004 19:36:07 -0700, Jon A. Cruz <jon@...18...> wrote:
vellum wrote:
bulia wrote>
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
Yes, ANSI is a subset of Unicode.
Actually, it's not.
ASCII is a subset of Unicode, but ANSI is a term that Microsoft "borrowed".
They adopted a scheme that never made it out of proposal for their character-set codepages. In general, it's 8-bit or multi-byte character set used by Microsoft. CP-1252 (Windows Western) is one "ANSI Code Page". CP-932 is another.
ASCII is a subset of Unicode. Latin-1 (ISO-8859-1) is also a subset of Unicode. ASCII is a subset of Latin-1. Cp-1252 is not a subset of Unicode (characters from $80 through $9f differ).
Usually (note that I said usually) most ANSI encodings will be a superset of ASCII, so most ASCII values will work.
(ASCII is 7-bit only, with values from 0 through 127)
I agree. vellum
----- Original Message ----- From: "bulia byak" <buliabyak@...400...> To: "Jon A. Cruz" <jon@...18...> Cc: "vellum" <vellum@...68...>; inkscape-devel@lists.sourceforge.net Sent: Friday, September 17, 2004 12:42 PM Subject: Re: [Inkscape-devel] Unicode and ANSI mode questions
My advice on all this mess: stick to Unicode and forget about anything
else :)
On Thu, 16 Sep 2004 19:36:07 -0700, Jon A. Cruz <jon@...18...> wrote:
vellum wrote:
bulia wrote>
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
Yes, ANSI is a subset of Unicode.
Actually, it's not.
ASCII is a subset of Unicode, but ANSI is a term that Microsoft
"borrowed".
They adopted a scheme that never made it out of proposal for their character-set codepages. In general, it's 8-bit or multi-byte character set used by Microsoft. CP-1252 (Windows Western) is one "ANSI Code Page". CP-932 is another.
ASCII is a subset of Unicode. Latin-1 (ISO-8859-1) is also a subset of Unicode. ASCII is a subset of Latin-1. Cp-1252 is not a subset of Unicode (characters from $80 through $9f differ).
Usually (note that I said usually) most ANSI encodings will be a superset of ASCII, so most ASCII values will work.
(ASCII is 7-bit only, with values from 0 through 127)
On Thu, 16 Sep 2004, bulia byak wrote:
Date: Thu, 16 Sep 2004 23:42:29 -0300 From: bulia byak <buliabyak@...400...> To: Jon A. Cruz <jon@...18...> Cc: vellum <vellum@...68...>, inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] Unicode and ANSI mode questions
On Thu, 16 Sep 2004 19:36:07 -0700, Jon A. Cruz <jon@...18...> wrote:
vellum wrote:
bulia wrote>
What is "ANSI value"? Same as ASCII? If so then ASCII is a subset of Unicode, you can use the Unicode mode as in the above.
Yes, ANSI is a subset of Unicode.
ANSI is not a subset of anything.
I fucking hate acronyms, bad, bad, bad. They cause all kinds of problems. As far as I remember ANSI is the American National Standards Institute. (A quick google confirms it). I am pretty sure it was explained at the very start of Kernigan and Ritchies ANSI C book (because I have read the beginning a few times but not actually read the book).
ASCII is the American Standard for Code Information Interchange (I looked it up, I left out the 'for', so that should be "American Standard Code for Information Interchange")
Actually, it's not.
ASCII is a subset of Unicode, but ANSI is a term that Microsoft "borrowed".
ASCII is a subset of Unicode, or more accurately Unicode was designed as a backwards compatible superset of ASCII. (I've read the FAQ on Unicode several times but I never seem to remember most of it.)
They adopted a scheme that never made it out of proposal for their character-set codepages. In general, it's 8-bit or multi-byte character
the code pages are a nasty attempt to hack multi character support on to ASCII and shouldn't be touched with a bargepole unless you have an extremely good reason to do so. Unicode is the way to go.
My advice on all this mess: stick to Unicode and forget about anything else :)
Definately.
Sincerely
Alan Horkan
http://advogato.org/person/AlanHorkan/ Inkscape, Draw Freely http://inkscape.org Free SVG Clip Art http://OpenClipArt.org
Alan Horkan wrote:
ANSI is not a subset of anything.
Just use http://www.acronymfinder.com/ instead of Google next time :)
- Felix
On Fri, 17 Sep 2004, Felix Rabe wrote:
Date: Fri, 17 Sep 2004 12:16:13 +0200 From: Felix Rabe <xitnalta@...128...> To: inkscape-devel@lists.sourceforge.net Subject: [Inkscape-devel] Acronyms
Alan Horkan wrote:
ANSI is not a subset of anything.
Just use http://www.acronymfinder.com/ instead of Google next time :)
The point is not that I am unable to use or undserstand acronyms, I sometimes forget myself and use acronyms for my own convenience but more often than not I end up having to write twice as much to explain the acronym. I correctly expanded the acronyms from memory and only needed Google to verify that, I did not even need to use the google keyword "define:".
In fact I know quite a lot of acronyms, and I know that there is a limited number of TLA's (Three Letter Acronyms) so there tend to be confilicts and acronyms are abiguous.
Did you know that SCUBA and RADAR are acronyms? Thankfully they have come into common usage (and in the case of scuba, there is the more descriptive term available: 'aqualung') and the original acronym has become unimportant, and I wish the same could happen to terms like GNU, KDE, and Gnome. Wiser minds have taken terms like SMB and turned it into "Samba". Other projects have picked acronyms/abbreviations that look like real words that do not require eplanation, the elm and pine mail clients are good examples. Developers have put up with so much nonsensical bad marketing (vapourware, "innovation", etc) there is a tendancy to over react and fail to appreciate the utility of good marketing and branding. Inkscape is an excellent brand name, it manages to be both distinctive and at the same time vaguely suggestive of the applications intended purpose.
The point is that acronyms add unnecessary confusion. Acronyms (and abbreviations) make it harder for otherwise intelligent people to understand what the hell you are talking about, scientists and engineers are terribly immodest and elitist and use complicated jargon to exclude normal people and make themselves feel important. It is annoying for us as computer scientists when we are outside of our expertise and people try to baffle us with bull, when there is a good chance we would understand exactly what they were talking about if they could just speak common English.
Not all people involved in computers have English as their first language. As I am not able to speak other languages as well as English it is my responsibility to at least use simple straightforward English and keep things as simple as possible. People often apologize for their poor English but I commend those who by necessity are forced to stuggle to express themselves in English, it is usually a lot better than my attempts at German would be.
"Just because I'm paranoid doesn't mean they are not out to get me." If this sounds like a rant, well that is because it is a rant but it is a rant that has a solid basis to it.
I encourage you all to try and keep in mind the idea "Keep It Simple Stupid" in all your writing, be it code or comments.
Sincerely
Alan Horkan
http://advogato.org/person/AlanHorkan/ Inkscape, Draw Freely http://inkscape.org Free SVG Clip Art http://OpenClipArt.org
participants (6)
-
Alan Horkan
-
Bob Jamison
-
bulia byak
-
Felix Rabe
-
Jon A. Cruz
-
vellum