Wednesday, January 13, 2010

Embroidery.. gaah


So for Christmas, Tove got this embroidery machine from Santa Claus. Since then, she's busily been filling the kids clothes with names, re-doing their Tae-Kwon-Do uniforms etc etc.

And why do I care? It turns out that all those embroidery machines can be extended with new patterns, and most of them - including the one Tove has - seem to use this special and pretty much undocumented "PES" format that was designed by Brother. So Tove has been buying embroidery patterns, but actually seeing them on the computer and transferring them to the sewing machine is a big pain.

So the above beautiful png file is what I did today. It's the result of me doing a thumbnailer for those PES files (and yes, "PES" stands for "PESky", I'm convinced), so that Tove can see the designs in her file manager as she moves them around.

I can read them (largely thanks to converting a php script written by Robert Heel - which in turn seems to be based on a GPL C# project from njcrawford.com - into C code) and then drawing them and writing the result out as a png out with cairo. Sadly, it seems that the embroidery machine itself sometimes has a rather harder time. When uploading the designs to the machine, a number of them just say "Data Error", which is very annoying.

I wonder what those embroidery machine firmware people were thinking. No diagnostics, no nothing. If a design is too large for the hoop of the machine, the machine accepts it (no "Data Error"), but doesn't actually show or use the design - it just silently ignores it.

Whee. Undocumented formats, bad firmware, lack of sane error messages. And did I mention crazy interfaces? The embroidery machine itself shows up as a USB storage device when you connect it, except it for some reason takes about half a minute to calm down enough to be mounted. And forget about the embroidery card reader/writer - that one needs some magic USB driver too.

But hey, if somebody else is fighting with PES files, here's a pointer to 'pesconvert', my git source tree for that silly thumbnailer that created the above png. You'll need pnglib-devel and cairo-devel to compile it, but it's small and simple. And in case you wonder about the source PES file, it's Jan_heartsdelight.pes, a demonstration PES image from brother.

35 comments:

Amber said...

couldn't resist:

<playful:sarcassisism>
Good to see you making a difference for society there, Linus!
</playful:sarcassisism>

On a slightly less frivolous note, good to see that guys like you (you know, 'kernel gods') still embark on pesky little projects like these when you have the itch (stitch?)

May I say the PNG looks lovely [*] :)

Seth

[*]talking about the rendering part

Ryan Lovett said...

I wrote (my first) Mac app a while back so that my mom could view and print PES files. I used the same C# code as a basis for my Objective-C.

http://code.google.com/p/needleworks/source/browse/
(no laughing)

Inkscape also has support for PES in svn:
https://bugs.launchpad.net/inkscape/+bug/247463

Unknown said...

I blogged in similar mode, last summer, http://lydgate.org/blogs/?p=17 regarding .jef files for Janome embroidery machines, and followed it up with http://lydgate.org/blogs/?p=22. Two busy people have worked entermittently on the project with a fair amount of success. I'll be passing the url of this blog to them, as there clearly is common ground.

Unknown said...

I sense the long living & prosperous embroidery industry it's coming to its end... :)

Adam Shirey said...

The bigger problem I see is the apparent inability to go the other direction: converting to PES from a vector or raster file. My mom's friend has a machine that will do the sewing, but the software to do the conversion is several thousand dollars -- prohibitively expensive for a hobbyist.

Any thoughts on writing PES files?

Joseph Kern said...

This is beautiful. Code and the modern arts and crafts movement. Glad to be posting this from a linux machine.

Keep up the great work.

Eric Sherrill said...

Maybe you should just get a Linux port for embroidery machines started. Can't be much worse than for cell phones eh?

Tet said...

Yep, my girlfriend has a similar machine. Some years ago, I managed to find some documentation for the PES format (nothing official, just what someone had reverse engineered and stuck up on the net somewhere), and started writing some tools to futz with it. From memory, PES is essentially a wrapper, containing information in another format (PEC, IIRC). Like most of my projects, it was never finished :-)

Jim said...

Linus, it all really depends on the embroidery machine. Some are easier to use and transfer files to than others and some have better diagnostics. My mother has a couple of embroidery machines, they are both Janome machines that use the JEF format for designs. All she does is put the designs on a USB stick and plugs it in to the machine, no need to connect to the computer. She previously had a machine that used PES format and required a USB connection. That was the most horrid machine and she aways had problems with it and of course it required her to boot into Windows just to transfer files(at the time she was using Ubuntu as her main OS) Now she uses a Mac, but sadly their is still not a big choice for good design/digitizing software on Mac either, so she sill has to boot into Windows to actually make designs. I'd really love to see an open source digitizer. As long as it supported at least one of the major embroidery formats, conversion to other formats could be done with existing software (many of which will run in WINE).

As of right now the process for creating her designs is as follows:
1. Create vector design in Inkscape.
2. convert to WMF
3. Boot into Windows
4. Digitize design into stitches with $$$$$ propretary Windows only software w/HASP.
5. Transfer design to USB stick
6. Stitch design

I think this process could be made much easier with open source digitizing software.

Anonymous said...

Knowing that Brother have been fairly good in regards to their Linux support, have you tried asking for some specs? ;)

Umberrella said...

I found this on Twitter. My mom does a lot of embroidery too and also makes her own designs. I recommmand you to watch her website which is: http://www.borduurmier.com

You can also write her an email if you have any questions. I know that she has various programs and solutions for transfering different files.

Jens Staal said...

So... 2010 will be the Year of Linux on the Embroidery Machine?

Still waiting for that toaster...although we are getting there - seen reports of a microwave.

:)

Anonymous said...

There is always the 90s' way to do cross-stich by converting your own pics: - Get W98, get a scanner, get drivers, get a printer, get drivers, get ink. It takes a month. - Give the bunch of papers to your wife. It takes a year for her to get the full masterpiece done. But it is worth it!

Modiste Kate said...

Why haven't you bought a 4000 serie or newer? Those machines can read files from USB media.
My own Innovis 1500D gets reloaded to no end under Windows Vista and 7, before the latest update it was fine... And on linux it just works...

Unknown said...

Bug report on imagemagick, you could add comments her. Hopefully a any format to/from pes will be coded soon.

http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=15374

Linus said...

Katherine: the machine is actually a Babylock Esante, which is, I think, basically the same as the Brother Innov-is 1500.

And yes, there are nicer machines out there that can take USB memory sticks, have color screens etc. They are also a lot more expensive ;)

Unknown said...

Regarding digitizing software...there is a program my mom uses called Sew What! Pro. It is <$100 (replaces the $1000< software mentioned by AE.) Seems to work really well for my mom.

Unknown said...

Hi! Mr. linus torvalds, The user's message in Chinese (Pls. ref. link at http://torvalds-family.blogspot.com/2008/10/penguins-on-parade.html) , there are pornographic messages and pornographic web site, please delete it best ! :(

by Richard Chng (http://twitter.com/i2linux2u)

Linus said...

Richard: the whole spam problem with blogger isn't something I can fix. I end up deleting spam on the most recent blog entries every once in a while, but not much more than that.

I'm actually very disappointed in the lack of automated spam-protection, and have considered just stopping the blog entirely. It's stupid how blogger allows obvious spam, and then also makes it painful to get rid of.

I'm not going to moderate comments manually. It's easy to find the spam: lots of links (or any links at all) is a pretty clear indication of spam. But blogger sadly doesn't seem to care.

Xavier said...

(...) and have considered just stopping the blog entirely (...)

Or maybe move to different blogging site. After all, there are still 21 entries missing for the current year! ;)

Anonymous said...

About spam and such: Linus, don't give up! / Ge inte up! / Älä anna periksi

Anonymous said...

I think, you can contact with Brother directly, to resolve PES format issues... If you want, of course.

Good luck, Linus ;-)

THECHIFLOWS said...

The kids are in the martial arts?. Please find them a good Classical Kung Fu school . So they can learn that there is beauty and grace in the martial arts . T.K.D , Just does not have it . It has become a watered down commercial unrealistic karate system since it's introduction to the U.S.A.

sgtrock said...

You do know that Tove was the six time Finnish national women's karate champion, don't you?

Unknown said...

I'm a professional embroidery digitizer/designer and if anything I can do will help bring embroidery and linux together, I'd love to offer my expertise. I wish I could code. :)

Sangeeta R. Goswami said...

Hii Linus
Me and sm of my frnds hv started an E-zine called Reader's Quotient, It is totally for a noble cause. I came across ur blog in my quest to search talented writers and felt worth to inquire if u shall be interested to come along us,
If yes pls contact us on sangeeta.goswami@readersquotient.com

waiting for ur revert

regds sangeeta
www.readersquotient.com

Ben said...

not exactly open (or even user friendly), but Embird (http://embird.com/) can handle editing/viewing most of the common (and uncommon) formats pretty well. I'd like to see a FOSS equivalent, but until then..

Unknown said...

Hello Linus

I bought my wife an embroidery machine about five years ago and she dropped all her other hobbies for several years doing projects and gifts. Everything was embroidered. As for designs, there are thousands of free designs out there on the web for downloading. At last count she had downloaded almost 200,000. There are good and bad out there, but at this point she knows where to go for the good ones.

Hope she enjoys her machine

Bryan

LadyMary said...

As a Linux user and seamstress, I would like to have a converter that allows one to use a regular memory card (say SD) with the older Brother embroidery machines. I don't understand why a card reader (that requires Win98+) and one (4MB) card should cost over $100. With a converter, I could copy files directly from my computer to the memory card, plug it into the converter, then into the machine, with no version of Win. needed. I am surprised no one has hacked an embroidery machine...

Modiste Kate said...

I totally agree with you, LadyMary, the specific cards is the most annoying part of Brother machines, however it's a well-known practice of hardware vendors. For example Sony sells their cameras with support of their own cards only.

Unknown said...
This comment has been removed by the author.
Unknown said...

@Linus: I just had to grin about Tove and her embroidery machine ... That's exactly the reason why I coded StitchBuddy for Mac OS X: My wife bought a Janome MC350E to be used with her iBook: a standard USB stick transfers JEF embroideries, but she lacked a way to view designs on the computer. Now StitchBuddy includes a Spotlight plugin to search for embroideries and has involved into an embroidery editor.

The Editor said...

My mom has a Brother Embroidery machine. It's one of the older ones that uses the odd little memory card thingies and PE Design. I got PE Design working great under WINE (i think) but I can't get the card reader to work. :(

Jessica @ One Shiny Star said...

This cracks me up. My husband says "Ya know, Linus Torvalds is..." I think he said something about you not looking like a wimpy, wispy pale nerd ... regardless, I'm enjoying your blog, and the fact that you talk about things like costco, and embroidery machines! Sorry I don't have anything PES or computer related to say!

Unknown said...

As a child who sought to be more attractive links of london chains , it is a little peculiar that I didn t like links of london animal charms such as ornaments, animal charms earrings and rings in the opening. links of london classic smiley To tell the candor, I didn t think charms is unusual and classic smiley charm I thought that the designs were too related. For example, links of london letters charms many charms were just minimal chains and they couldn t letters charm magnetize my interest at all. links of london heart charms So I seldom bought or wore a section of rings. heart charms In statement, lacking an exclusive instance of bracelets, friendship bracelets I had gone much.I couldn t judge that I fell in adore with links of london heart bracelets That was one of my big changes. heart bracelet After all, I didn’t like ornaments at all in the launch. Since I fell in dear with links of london Sweetie necklaces , I had realized that an instance of links of london Sweetie rings could bring me much more links of london watch charms