Dithered greyscale tiles

I am looking for a neat way to draw a grid of dithered greyscale tiles. So far I’ve been stumped:

  1. drawing a scaled up greyscale image, with setDitherPattern (greyscale images not supported)
  2. drawing a tile map using a set of greyscale dither images generated with image:fadedImage (generated image table not supported)

Looks like the only way is to pre-render an asset with all those dither tiles.

Yes, these are your main options.

One more alternative would be to split your image into multiple images - one for each shade of grey - and then process them in your game.

My personal choice would be to convert/dither your tiles outside of Playdate, as you have more control. I do it using (image)magick on the command line, as part of my build process, though I appreciate that might be seen as a bit hardcore.

If you have any preference for tools or apps, let us know and we can help more.

1 Like

Yeah, to clarify - my feature requests are:

  1. greyscale images, that are either snapped to 1 bit or screen space dithered on the fly using setDitherPattern
  2. API to construct image table from images at runtime

will post a video of what I’m working on

Oh, I missed that this was a feature request thread :man_facepalming:

I’ll add my +1 to both

  1. I asked about this early on at Discord (direct link) everything is built around 1-bit conversions at compile time, so it’s not possible. But some additions are being planned (see the following comments at the above link)

    My workarounds involve splitting my image into one layer per greyscale (for my stages) and using (image)magick to process RGBA into different dithers (for my cars).

  2. I’d also love this and have asked about it at Discord (direct link) but I don’t believe there was an official response to it.

    Currently I do some runtime dithering processing of 1980 frames for a sprite, which takes a second or two. I’d prefer to do it to a full image and then use that image as the source for an image table to create a sprite out of it.

1 Like

Wow, +100 answer!

Love what I’ve seen of your cars.

Regards,
Finn

torch_test

5 Likes

Nice!

How about crank-controlled Squareball?

Yeah, toying with the idea! Did you play it back then? I’m waiting for Super Hexagon…

Regards,
Finn

Yeah, I played Squareball at the time!

1 Like

lighting is real-time in that video btw

1 Like