Mac app that converts an image into 8-bit art like spritely

Is there an app that does that? If so, please LMK. I want some of my images in Codea without hacking.
Thanks!

Would Pixelmator work for you? I find it an excellent photoshop replacement.

Sorry, 8-bit art code like spritely. Pixelmator does look really cool though. @Blanchot If it does, please LMK because that would be amazing.
Thanks!

Well I found an ASC II image converter for iPhone here and the website here. Thats now help unless Codea can do ASC II.

I really would like some help…

it’s ASCII - American Standard Code for Information Interchange. it’s just text.

You’d need to write something to read each line as a string, then take each character and either set into an image, or do a rect(), or something like that.

I know. It seams BMPs have that encoding but I don’t know how to access the code.
Please help!

http://www.roseindia.net/java/java-get-example/get-color-of-pixel.shtml

Thanks. Getting closer. I might end up stealing some code from @Mark’s app Spritely and turn it into a mac app… Maybe. Eventually, possible an iPhone app. It’s fairly easy to do that.

BMP files are RLE (Run Length Encoded), not ASCII.

see http://atlc.sourceforge.net/bmp.html

A few places it said it was 8-bit art. Oh. They mean something else.

8-bit art is also known as pixel art - there’s a differentiation between 8-bit art (what you’d see on an old video game), and 16-bit art (as you’d see on a newer generation but still older console, like a Sega). There’s also isometric pixel art.

hee hee - the rabbit hole just gets deeper and deeper…

No… This is not Alice in Wonderland… Thank you. Alright. Thank’s for giving me correct definitions.

I’ve just tried converting an image (originally PNG) to “Plain PPM” format (using the NetPNM libraries) and then wrote a simple perl script to convert that to a lua file that defines a sprite (image). It worked, though the resulting file was 4000 lines long! (The original was a 200x200 image).

Here’s the perl script:

#! /usr/bin/perl -w

$infile = shift(@ARGV);
$outfile = shift(@ARGV);
($img = $infile) =~ s/\\.[^.]*$//;

open INFILE, $infile
    or die "Couldn't open $infile for reading\
";
open OUTFILE, ">$outfile"
    or die "Couldn't open $outfile for writing\
";

while (<INFILE>) {
    chomp;
    s/#.*//;
    @a = split(/\\s+/, $_);
    while (@a) {
	$a = shift(@a);
	if ($a eq 'P3') {
	    $width = 0;
	    $height = 0;
	    $maxval = 0;
	    @pixel = ();
	    $x = 1;
	    $y = 1;
	} elsif (!$width) {
	    $width = $a;
	} elsif (!$height) {
	    $height = $a;
	    print OUTFILE "$img = image($width,$height)\
";
	} elsif (!$maxval) {
	    $maxval = 255/$a;
	} else {
	    push @pixel, $a * $maxval;
	    $p = @pixel;
	    if ($p == 3) {
		print OUTFILE "$img:set($x,$y," . join(",",@pixel) . ",255)\
";
		$x += 1;
		if ($x > $width) {
		    $y += 1;
		    $x = 1;
		}
		@pixel = ();
	    }
	}
    }
}
    

Call as ./plpnm2lua.pl image.pnm file.lua.

Hmm. I’ll try it. Thanks.

After trying it, I realised that I had the y-axis upside-down. I’ll fix it later.

FWIW - the “convert it thru NetPNM” path was how I did my first tomfez image back when they first added image() to Codea.

It convinced me we really need some way to load/save pure binary data to/from somewhere. And ideally, built-in compression. Pictures are big.

TLL: Gimmie Zlib! Please. I do beg of thee.

I’d forgotten that.

Hey, I’ve just had a great idea! Round things would roll nicely down hills. Let’s make some round things. I think this has a lot of potential.

Can’t find anything on google. I don’t know what to do. I really would like this. If one of the people from TLL could help, that would be great. Thanks!

I looked around as well and turned up nothing for this in particular.

Graphics are just difficult and large in general. It gives an application for the the formats and processing that is out there.

A nice feature for Codea would be to import graphics to a shared area in the app and then be able to copy them into projects. It would be similiar to the way .codea was but wouldn’t alarm Apple as it is graphics not code. These graphics formats could then be directly loaded using image() somehow.