Spritely -- a simple image editor

Clearly you must go on to build a game in which Bender steals cigars and beer – after all, dont forget the one commandment: god needs booze!

Nice to see the this thing being used. Good work.

That sounds like fun, just got to finish Crabitron first :slight_smile:

A minor update. I was creating some icons for… let’s just say a game in which a chubby guy in coveralls jumps over things, and it became clear that being able to mirror and image image would be nice (so you don’t have to draw both left and right facing versions of asymmetrical sprites). So I added a tool that does just that.

I also changed the way the flood tool works. It occurred to me that it was kind of worthless the way it was, so I changed it to flood only blank pixels. Not sure that’s much better. I may change it to do color-swapping instead.

Did some general clean up and minor cosmetic adjustments.

http://devilstower.posterous.com/spritely-060

Heh - I had to ask myself just that question (I just did a flood fill for my Pic library) - I suggest you make it flood fill pixels of the same color where you tap, ie. pick it, then tap a square - and it flood fills from that square out over all pixels of the same color. So you could change Bender’s eyes above from yellow to red in two taps.

PS. I love the sample icons you have in there. :slight_smile:

I still haven’t fixed the fact that the save and load arrows appear to be facing wrong way. Until a new release comes out this is relatively easy for people to do: under main add this saveBtn = Button(700, HEIGHT - 200, 5)
loadBtn = Button(700, HEIGHT - 250, 3) instead of what is there for the saveBtn and loadBtn. All this does is switch the icons so that the save one will be where load goes and load will be where save goes making them face the right way since the pushing of buttons is really just touching that part of screen regardless of wheter or not the correct button is there. Hope this helps!

*u still haven’t fixed, my bad not I :slight_smile:

Have you upgraded to Codea 1.2.5? If so, the save arrow should be pointing down and the load arrow should be pointing up. To my mind, that was the “right” way… though I suppose that’s open to interpretation.

Just got a chance to grab this. Thanks so much for it.

Thanks. I’m trying to think of what else would be nice here. Maybe buttons to nudge the image one pixel when it turns out your design started just a smidgen off?

Not sure if these would be useful, but here are some ideas:

  • An invert tool (just do {255 - r, 255 - g, 255 - b, a} for each pixel)
  • A box blur - a simple blur that averages pixels
  • Hue shift slider - rotates your colours through different hues (affects all pixels in the sprite). This would be handy for making colour variations of a particular icon.
  • Saturation slider (affects all pixels in the sprite)

This is something I put together to browse colors by name combining the classes provided by a few different people. I think someone may have even posted something similar that works better.

http://ipad41001.posterous.com/color-picker

It’s a bit slow. I didn’t improve it since I just use it to browse. Possibly one of the color boxes would be like a custom color. You click on it and it displays this list in some form.

That’s a pretty cool combination, @Ipda41001

One way would be to implement custom sliders, maybe as here: 
 http://szleski.posterous.com/hslider 

@szleski… Thank you for putting together and posting this class!

Have been playing with spritely further, mainly as a way to think about gui stuff, but have a few new features and might be useful to other people. The code is messy, buggy and pretty disconnected from Mark’s original version - sorry about that.

http://ruilov.posterous.com/sup-spritely2

  • merged with keyboard class so you can type in the image name

  • added a fill button that fills in just that section of that image (all neighbors with the same color)

  • added a select button that lets you select a chunk of the image and move around

  • handles 2 image formats of my own (bitmap and ImageFont) and Mark’s spritely format

I would love for mark to add these features. Also if @Simeon built Spritely in to Codea.

I really need to get on the stick. These are great additions!

I’ve fiddled a bit in the last couple of days – upping the list of saved icons, adding an invert function. But these new bits from ruilov are cool. I’ll see if I can harmonize the two versions.

I feel bad for taking on a different direction, i dont feel like you should have to understand my dirty code. If you want me to write the new functionality into the orignal version just say the word.

Looking forward to your update Mark!

New version should be up tonight. Complete ground-up rewrite with full screen, new sliders, buttons, “file manager” etc. barely a line survives from the previous version.

In other words, I had fun. Some code clean up and testing and I’ll boot it out there.