To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.announceOpen lugnet.announce in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Announcements / 3450
     
   
Subject: 
Announcing Bitsticker
Newsgroups: 
lugnet.announce, lugnet.cad
Followup-To: 
lugnet.cad
Date: 
Thu, 1 Mar 2007 02:48:51 GMT
Highlighted: 
!! (details)
Viewed: 
10844 times
  

I’d like to announce the availability of a little script I wrote that converts small bitmap images (JPG, PNG, GIF) to “stickers” that you can use in your LDraw models. The script is called Bitsticker and there’s nothing to download: just visit http://anoved.net/bitsticker.html and upload your image!

Bitsticker Example Gallery

Precautions: I’d like to make clear that by its very nature this script produces very large and inefficient LDraw files (it renders each pixel as a quadrilateral). It’s an abuse of the format, frankly, but it can be fun to tinker with, even if it isn’t appropriate for serious part authoring. I do recommend using placeholder parts instead of these stickers until you’ve finished arranging a model, as such complex parts can be cumbersome to manipulate.

Size: There are a few scaling options. You can specify the size of each pixel in LDraw units, or you can specify the desired overall size of the sticker and have Bitsticker stretch or scale the image to fit.

Color: By default, Bitsticker uses hexadecimal color codes to preserve the true color of the image. Since this color format is not a standard convention, Bitsticker can also be made to substitute the most similar official color for each pixel. Colors can be substituted from the original set of 15 LDraw colors, a typical ldconfig.ldr file, or an ldconfig file you upload containing custom color code definitions. You can also specify the color of the sticker “paper” (the back and side surfaces) as an LDraw color code or in 0x02RRGGBB fashion (it defaults to white).

Layout: In rough accordance with the specification for real LDraw stickers, the image is rendered parallel to and -0.25 units above the XZ plane. It is centered over the origin, so the middle of the back surface of the sticker lies at 0,0,0. The back and side surfaces are the last five lines output, so if you just want the image you can delete those lines.

Recursive
Bitsticker screenshot

Let me know what you think, and in particular, please let me know about any cases where the script appears to malfunction without identifying the error. I’m also curious what programs do support this truecolor format; it works with LDView, but I need to use regular LDraw colors for Bricksmith and ldglite. Haven’t tried anything else yet.

If you’re curious, you can download the LDraw files for the “art gallery” example shown above. There are two versions: one that uses true colors (1.4 MB) and one that uses basic LDraw colors (1.3 MB). If you’re real curious, you might be wondering just what those minifigs are staring at: John Singer Sargent’s “Madame X”; Edvard Munch’s “The Scream”; Francisco de Goya’s “Saturn devouring his son”; Leonardo da Vinci’s “Mona Lisa”; and lastly, one of my own doodles. Notice which piece seems to be the most popular tonight. I’ve got nothing to do with that. Honest!

Be well,

Jim

   
         
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Thu, 1 Mar 2007 16:38:57 GMT
Viewed: 
2123 times
  

In lugnet.announce, Jim DeVona wrote:
   I’d like to announce the availability of a little script I wrote that converts small bitmap images (JPG, PNG, GIF) to “stickers” that you can use in your LDraw models. The script is called Bitsticker and there’s nothing to download: just visit http://anoved.net/bitsticker.html and upload your image!

That is very cool. I’m even going to spotlight it to get it above my post about getting pretty things on the NXT... ;-)

Actually, if I upload the graphics I used on the NXT to your script I can make them appear on the display screen of Philo’s LDRAW model of the NXT..!

Jason R

    
          
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Thu, 1 Mar 2007 17:51:10 GMT
Viewed: 
2113 times
  

In lugnet.cad, Jason J Railton wrote:

   In lugnet.announce, Jim DeVona wrote:

   I’d like to announce the availability of a little script I wrote that converts small bitmap images (JPG, PNG, GIF) to “stickers” that you can use in your LDraw models. The script is called Bitsticker and there’s nothing to download: just visit http://anoved.net/bitsticker.html and upload your image!

That is very cool. I’m even going to spotlight it to get it above my post about getting pretty things on the NXT... ;-)

That is pretty clever, by the way. It reminds me of grayscale on graphing calculators (like this or this). That gives me a silly idea. LDraw on a TI-92.

   Actually, if I upload the graphics I used on the NXT to your script I can make them appear on the display screen of Philo’s LDRAW model of the NXT..!

Cool! That is a great application for it. Let me know how it goes.

Jim

   
         
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Thu, 1 Mar 2007 22:22:18 GMT
Viewed: 
2197 times
  

You might want to add the following two lines to the tops of your generated files:
0 UNOFFICIAL PART
0 BFC CERTIFY CW
Adding the above two lines will enable BFC processing. The first line is needed because most models don’t contain a 0 BFC CERTIFY line in them.

--Travis

    
          
      
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 00:04:28 GMT
Viewed: 
2176 times
  

In lugnet.cad, Travis Cobbs wrote:

   You might want to add the following two lines to the tops of your generated files:
0 UNOFFICIAL PART
0 BFC CERTIFY CW
Adding the above two lines will enable BFC processing. The first line is needed because most models don’t contain a 0 BFC CERTIFY line in them.

--Travis

No sooner said than done! Thank you for the suggestion. I figured it would be good to wind the polygons consistently but I didn’t think to declare it with BFC. Doing so is clearly beneficial.

Jim

    
          
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 00:45:11 GMT
Viewed: 
2377 times
  

In lugnet.cad, Travis Cobbs wrote:
   You might want to add the following two lines to the tops of your generated files:
0 UNOFFICIAL PART
0 BFC CERTIFY CW
Adding the above two lines will enable BFC processing. The first line is needed because most models don’t contain a 0 BFC CERTIFY line in them.

Thanks for pointing this out, I just realised txt2dat does not include any header at all. I’d better fix that :)

ROSCO

    
          
     
Subject: 
Re: Announcing Bitsticker (and other txt/bit-to-dat utilities)
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 02:48:10 GMT
Viewed: 
2639 times
  

In lugnet.cad, Ross Crawford wrote:

   In lugnet.cad, Travis Cobbs wrote:

   You might want to add the following two lines to the tops of your generated files:
0 UNOFFICIAL PART
0 BFC CERTIFY CW
Adding the above two lines will enable BFC processing. The first line is needed because most models don’t contain a 0 BFC CERTIFY line in them.

Thanks for pointing this out, I just realised txt2dat does not include any header at all. I’d better fix that :)

ROSCO

Hey, txt2dat is cool! It looks like it should build on the Mac, too, so I’m puttering with rewriting the Makefile to make that happen. (The triangle library builds fine with the -DLINUX switch turned off.) It’s part of my new crusade to get every LDraw program on earth ported to the Mac. Any other LDraw utility authors - watch out! You’re next. ;-)

More seriously, as I was just searching through the Lugnet archives for further incriminating evidence that I’ve sort of been reinventing the wheel with Bitsticker, I came upon this thread by Tim Gould from 2005: Automatic sticker creation. That is clearly a more practical implementation of an image-to-LDraw converter! Has that been released? More to the point, I’m simply curious about how the vectorization is achieved. This comment in particular is right on:

   The advantage this has over BMP2DAT (from what I can gather, haven’t really used it) is that my program finds the lines and then triangulates the resulting polygon rather than turning pixels into quads (correct me if this is not what BMP2DAT does).

Does it use a library like potrace or did you write your own vectorization code? (I’ve done a lot of work with remote sensing and GIS so vectorization is just a fascinating topic to me.) Hopefully I have just overlooked some more recent announcement pertaining to this project.

Thanks,

Jim

    
          
      
Subject: 
Re: Announcing Bitsticker (and other txt/bit-to-dat utilities)
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 03:02:32 GMT
Viewed: 
2709 times
  

In lugnet.cad, Jim DeVona wrote:
   In lugnet.cad, Ross Crawford wrote:

   In lugnet.cad, Travis Cobbs wrote:

   You might want to add the following two lines to the tops of your generated files:
0 UNOFFICIAL PART
0 BFC CERTIFY CW
Adding the above two lines will enable BFC processing. The first line is needed because most models don’t contain a 0 BFC CERTIFY line in them.

Thanks for pointing this out, I just realised txt2dat does not include any header at all. I’d better fix that :)

Hey, txt2dat is cool! It looks like it should build on the Mac, too, so I’m puttering with rewriting the Makefile to make that happen. (The triangle library builds fine with the -DLINUX switch turned off.) It’s part of my new crusade to get every LDraw program on earth ported to the Mac. Any other LDraw utility authors - watch out! You’re next. ;-)

Hey, that’d be great! The makefile is a bit of a rat’s nest, because I borrowed it from the freetype library, and modified it. The main reason I did that was for cross-platform compatability, but I’ve never had a Mac to try on. If you can get it to build on the Mac, I’d be happy to work any changes into the official version.

ROSCO

     
           
      
Subject: 
txt2dat on Mac OS X (was Re: Announcing Bitsticker)
Newsgroups: 
lugnet.cad, lugnet.cad.dev.mac
Date: 
Fri, 2 Mar 2007 04:59:11 GMT
Viewed: 
5999 times
  

In lugnet.cad, Ross Crawford wrote:

   In lugnet.cad, Jim DeVona wrote:

   Hey, txt2dat is cool! It looks like it should build on the Mac, too, so I’m puttering with rewriting the Makefile to make that happen. (The triangle library builds fine with the -DLINUX switch turned off.) It’s part of my new crusade to get every LDraw program on earth ported to the Mac. Any other LDraw utility authors - watch out! You’re next. ;-)

Hey, that’d be great! The makefile is a bit of a rat’s nest, because I borrowed it from the freetype library, and modified it. The main reason I did that was for cross-platform compatability, but I’ve never had a Mac to try on. If you can get it to build on the Mac, I’d be happy to work any changes into the official version.

Hi Ross,

It works! I just built it by hand, so I’ll write a simple makefile for it tomorrow. Only issue is that the version of Freetype 2 that comes with OS X doesn’t seem to know about FT_Orientation, so I just ifdeffed out the few bits that referred to that, possibly at the expense of handling certain cases (Postscript fonts which are wound the other way, perhaps? I dunno).

txt2dat on OS X

I have a proposition: working out a Mac build is great, but what would you say to adapting txt2dat to run on the web (like Bitsticker)? Even more than my Mac crusade, I like the idea of making all these LDraw tools more accessible to the casual user, who may not be so keen on the command line or even just installing lots of little programs. I’d be willing to work on that, when possible, and I could even host it since my web server supports compiled CGI “scripts.”

Jim

     
           
      
Subject: 
Re: txt2dat on Mac OS X (was Re: Announcing Bitsticker)
Newsgroups: 
lugnet.cad, lugnet.cad.dev.mac
Date: 
Fri, 2 Mar 2007 06:34:06 GMT
Viewed: 
6103 times
  

In lugnet.cad, Jim DeVona wrote:
   In lugnet.cad, Ross Crawford wrote:

   In lugnet.cad, Jim DeVona wrote:

   Hey, txt2dat is cool! It looks like it should build on the Mac, too, so I’m puttering with rewriting the Makefile to make that happen. (The triangle library builds fine with the -DLINUX switch turned off.) It’s part of my new crusade to get every LDraw program on earth ported to the Mac. Any other LDraw utility authors - watch out! You’re next. ;-)

Hey, that’d be great! The makefile is a bit of a rat’s nest, because I borrowed it from the freetype library, and modified it. The main reason I did that was for cross-platform compatability, but I’ve never had a Mac to try on. If you can get it to build on the Mac, I’d be happy to work any changes into the official version.

Hi Ross,

It works! I just built it by hand, so I’ll write a simple makefile for it tomorrow. Only issue is that the version of Freetype 2 that comes with OS X doesn’t seem to know about FT_Orientation, so I just ifdeffed out the few bits that referred to that, possibly at the expense of handling certain cases (Postscript fonts which are wound the other way, perhaps? I dunno).

Hmmm, interesting. txt2dat is currently compiled against 2.1.9, I haven’t tried upgrading since txt2dat is the only thing I use it for. But the API doc at the freetype site still documents the FT_Orientation API. Also, version 2.3.1 (which I just downloaded to check) seems to include it. What version do you have?

It also documents the FT_OUTLINE_REVERSE_FILL flag, which I do vaguely remember from when I originally wrote the program, and can’t remember why I didn’t use it. Does your version support that flag? If so, I’ll look into using that instead. Type 1 (Postscript) fonts are wound the other way (at least the ones I have are) so we do need to take it into account.

   I have a proposition: working out a Mac build is great, but what would you say to adapting txt2dat to run on the web (like Bitsticker)? Even more than my Mac crusade, I like the idea of making all these LDraw tools more accessible to the casual user, who may not be so keen on the command line or even just installing lots of little programs. I’d be willing to work on that, when possible, and I could even host it since my web server supports compiled CGI “scripts.”

That’s also a great idea, but I’ll still continue to maintain the stand-alone executable separately, so it’ll be up to you to incorporate any changes I may make to the original :) Either way, I’m happy put a to link on my page.

ROSCO

     
           
      
Subject: 
Re: txt2dat on Mac OS X (was Re: Announcing Bitsticker)
Newsgroups: 
lugnet.cad, lugnet.cad.dev.mac
Date: 
Fri, 2 Mar 2007 14:44:23 GMT
Viewed: 
6351 times
  

In lugnet.cad, Ross Crawford wrote:

   In lugnet.cad, Jim DeVona wrote:

   Hi Ross,

It works! I just built it by hand, so I’ll write a simple makefile for it tomorrow. Only issue is that the version of Freetype 2 that comes with OS X doesn’t seem to know about FT_Orientation, so I just ifdeffed out the few bits that referred to that, possibly at the expense of handling certain cases (Postscript fonts which are wound the other way, perhaps? I dunno).

Hmmm, interesting. txt2dat is currently compiled against 2.1.9, I haven’t tried upgrading since txt2dat is the only thing I use it for. But the API doc at the freetype site still documents the FT_Orientation API. Also, version 2.3.1 (which I just downloaded to check) seems to include it. What version do you have?

I believe it is freetype 2.1.4 (based on the major/minor/patch definitions in freetype.h). The headers are last dated 2002, and a look at more recent freetype changelogs suggests that predates the introduction of “FT_Orientation.” It’s annoying that the preinstalled libraries aren’t more up to date.

   It also documents the FT_OUTLINE_REVERSE_FILL flag, which I do vaguely remember from when I originally wrote the program, and can’t remember why I didn’t use it. Does your version support that flag? If so, I’ll look into using that instead. Type 1 (Postscript) fonts are wound the other way (at least the ones I have are) so we do need to take it into account.

Yes, FT_OUTLINE_REVERSE_FILL is defined on my system.

  
   I have a proposition: working out a Mac build is great, but what would you say to adapting txt2dat to run on the web (like Bitsticker)? Even more than my Mac crusade, I like the idea of making all these LDraw tools more accessible to the casual user, who may not be so keen on the command line or even just installing lots of little programs. I’d be willing to work on that, when possible, and I could even host it since my web server supports compiled CGI “scripts.”

That’s also a great idea, but I’ll still continue to maintain the stand-alone executable separately, so it’ll be up to you to incorporate any changes I may make to the original :) Either way, I’m happy put a to link on my page.

Cool. I don’t think any modifications to txt2dat itself will even be necessary: I’ll write a CGI script that passes it arguments and returns its output. That would make it easy to keep the web version in sync with the regular version.

I just checked and txt2dat builds on my server no problem (it has FT 2.1.9). I’ll work out my makefile later today.

Jim

     
           
      
Subject: 
Re: txt2dat on Mac OS X (was Re: Announcing Bitsticker)
Newsgroups: 
lugnet.cad, lugnet.cad.dev.mac
Date: 
Fri, 2 Mar 2007 17:11:38 GMT
Viewed: 
6281 times
  

In lugnet.cad, Jim DeVona wrote:

   I just checked and txt2dat builds on my server no problem (it has FT 2.1.9). I’ll work out my makefile later today.

Here is my rudimentary makefile for building txt2dat on my Mac and a linux machine. No guarantees it will work for anyone else but hopefully it could be helpful. Also a copy of txt2dat.c containing my quick checks to get around the lack of FT_Orientation in my old version of Freetype.
This makefile goes in the same folder as the original and I build it with make -f Makefile.alt (it puts the txt2dat program in the same folder as well).

Jim

    
          
     
Subject: 
Re: Announcing Bitsticker (and other txt/bit-to-dat utilities)
Newsgroups: 
lugnet.cad
Date: 
Mon, 19 Mar 2007 19:09:03 GMT
Viewed: 
3045 times
  

--snip--

   More seriously, as I was just searching through the Lugnet archives for further incriminating evidence that I’ve sort of been reinventing the wheel with Bitsticker, I came upon this thread by Tim Gould from 2005: Automatic sticker creation. That is clearly a more practical implementation of an image-to-LDraw converter! Has that been released? More to the point, I’m simply curious about how the vectorization is achieved. This comment in particular is right on:

   The advantage this has over BMP2DAT (from what I can gather, haven’t really used it) is that my program finds the lines and then triangulates the resulting polygon rather than turning pixels into quads (correct me if this is not what BMP2DAT does).

Does it use a library like potrace or did you write your own vectorization code? (I’ve done a lot of work with remote sensing and GIS so vectorization is just a fascinating topic to me.) Hopefully I have just overlooked some more recent announcement pertaining to this project.

Thanks,

Jim

Unfortunately I got too busy with other things and kind of let is slide. With a rewrite in a compiled language and using a decent triangulation (such as the one Ross uses) and vectorisation algorithm I suspect it could be made to work better.

Tim

    
          
     
Subject: 
Re: Announcing Bitsticker (and other txt/bit-to-dat utilities)
Newsgroups: 
lugnet.cad
Date: 
Mon, 19 Mar 2007 19:25:49 GMT
Viewed: 
3148 times
  

In lugnet.cad, Timothy Gould wrote:
   --snip--

   More seriously, as I was just searching through the Lugnet archives for further incriminating evidence that I’ve sort of been reinventing the wheel with Bitsticker, I came upon this thread by Tim Gould from 2005: Automatic sticker creation. That is clearly a more practical implementation of an image-to-LDraw converter! Has that been released? More to the point, I’m simply curious about how the vectorization is achieved. This comment in particular is right on:

   The advantage this has over BMP2DAT (from what I can gather, haven’t really used it) is that my program finds the lines and then triangulates the resulting polygon rather than turning pixels into quads (correct me if this is not what BMP2DAT does).

Does it use a library like potrace or did you write your own vectorization code? (I’ve done a lot of work with remote sensing and GIS so vectorization is just a fascinating topic to me.) Hopefully I have just overlooked some more recent announcement pertaining to this project.

Thanks,

Jim

Unfortunately I got too busy with other things and kind of let is slide. With a rewrite in a compiled language and using a decent triangulation (such as the one Ross uses) and vectorisation algorithm I suspect it could be made to work better.

Tim

Hmmm. It would appear that using the Potrace API and the Triangle API would do almost all the difficult work for software of this sort. I might look into restarting the project although I’m not sure how far I could get with it. Of course if anyone would like to take it over I’d be willing to offer as much help (including source code) as I could.

Tim

    
          
     
Subject: 
Re: Announcing Bitsticker (and other txt/bit-to-dat utilities)
Newsgroups: 
lugnet.cad
Date: 
Mon, 19 Mar 2007 20:20:39 GMT
Viewed: 
3602 times
  

In lugnet.cad, Timothy Gould wrote:
   In lugnet.cad, Timothy Gould wrote:
   --snip--

   More seriously, as I was just searching through the Lugnet archives for further incriminating evidence that I’ve sort of been reinventing the wheel with Bitsticker, I came upon this thread by Tim Gould from 2005: Automatic sticker creation. That is clearly a more practical implementation of an image-to-LDraw converter! Has that been released? More to the point, I’m simply curious about how the vectorization is achieved. This comment in particular is right on:

   The advantage this has over BMP2DAT (from what I can gather, haven’t really used it) is that my program finds the lines and then triangulates the resulting polygon rather than turning pixels into quads (correct me if this is not what BMP2DAT does).

Does it use a library like potrace or did you write your own vectorization code? (I’ve done a lot of work with remote sensing and GIS so vectorization is just a fascinating topic to me.) Hopefully I have just overlooked some more recent announcement pertaining to this project.

Thanks,

Jim

Unfortunately I got too busy with other things and kind of let is slide. With a rewrite in a compiled language and using a decent triangulation (such as the one Ross uses) and vectorisation algorithm I suspect it could be made to work better.

Tim

Hmmm. It would appear that using the Potrace API and the Triangle API would do almost all the difficult work for software of this sort. I might look into restarting the project although I’m not sure how far I could get with it. Of course if anyone would like to take it over I’d be willing to offer as much help (including source code) as I could.

Tim

Neat. I have also used autotrace, a similar program. I haven’t used either enough to recommend one over the other, but for some reason I do recall preferring potrace’s output. (I’ve only used the programs, not programmed with them.)

I don’t know how much use people would find for it (the same applies to Bitsticker), but personally I think this would be a really cool program. I can’t offer to take it over, but as with a couple other LDraw programs I’ve had my fingers in recently, I’d be glad to help test it out.

Take care,

Jim

   
         
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 00:31:37 GMT
Viewed: 
2194 times
  

You might consider adding an option to use color 16 (or perhaps the “paper” color) for fully transparent pixels in uploaded PNG files.

--Travis

    
          
     
Subject: 
Re: Announcing Bitsticker
Newsgroups: 
lugnet.cad
Date: 
Fri, 2 Mar 2007 01:34:14 GMT
Viewed: 
2135 times
  

In lugnet.cad, Travis Cobbs wrote:

   You might consider adding an option to use color 16 (or perhaps the “paper” color) for fully transparent pixels in uploaded PNG files.

Another excellent idea. You’ll have the option to use the paper color for transparent pixels, and then you can set the paper color to anything you want (including 16).

I’m tempted to throw it in right now, but I’ve actually just started rewriting Bitsticker in C for blazing speed and other possibilities, so transparency will be among the “flagship features” of that release.

Be well,

Jim

   
         
   
Subject: 
Minor Bitsticker update
Newsgroups: 
lugnet.cad
Date: 
Wed, 7 Mar 2007 03:17:30 GMT
Viewed: 
2193 times
  

In lugnet.announce, Jim DeVona wrote:

   I’d like to announce the availability of a little script I wrote that converts small bitmap images (JPG, PNG, GIF) to “stickers” that you can use in your LDraw models. The script is called Bitsticker and there’s nothing to download: just visit http://anoved.net/bitsticker.html and upload your image!

I realized that Bitsticker would generate really long output filenames resembling the path to the original image when used with browsers like Internet Explorer 6. I’ve fixed it so that the output filename should be derived only from the filename of the uploaded image.

I’ve also noticed that Stuffit Expander doesn’t seem to like Bitsticker’s zip files (made with Archive::Zip). I would advise any Mac users with Stuffit Expander to try unzipping the stickers with a different program, such as Mac OS X’s built-in default unzipper. The files work fine with WinZip.

Since making txt2dat online, I’ve postponed the Bitsticker rewrite I alluded to elsewhere in order to consider a similar design comprised of a separate core program that can be downloaded to use without a web page interface. It’s not a high priority project.

Be well,

Jim

 

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR