Log In  

A couple options (totally different methods) to display big titles, e.g. a 'game over' screen or 'the end' in the style of silent movies.

Method 1 - Map and sprite tiles

You draw a few sprite tiles with corners and reusable portions to form your title.
Pros: all the advantages of Pico-8's maps and easy to edit your title
Cons: you need some free area in your Map and you spend tiles of your spritesheet

Method 2 - P8scii One-Off characters

You can use this spritesheet to P8scii string converter here to obtain a printable string that will display the title (or logo etc..).
Pros: no map, no spritesheet, just a big string
Cons: pick your image carefully, avoid one with many stray pixels (read hints in the linked One-off page) or it will eat compressed characters space.

Press:

  • Z to restart the animation.
  • X to swap the method (One-off gfx / map)

Cart #oldtimeytitle-0 | 2022-11-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
13

P#120294 2022-11-08 01:04 ( Edited 2022-11-19 16:14)

Looking sharp, @Heracleum !

Is that picture above using 2-colors per 8x8 tile ?

P#120295 2022-11-08 01:57

@dw817 actually I didn't refine much the input image so in a few spots the antialias cause 3 or 4 colours per block (it's around 2k chars)

P#120302 2022-11-08 09:37
1

What are the advantages/disadvantages over just using px9 for the storage of images?

P#120310 2022-11-08 13:48
3

Quite a few, @SquidLight. For instance, I am making use of @Heracleum's image compressor in my latest project for two reasons that outweigh PX9. (Gold star BTW)

https://www.lexaloffle.com/bbs/?tid=50113

Here are =2= main reasons I am using this program.

  1. Convenience. You just PRINT a single statement that draws your picture. PX9 requires you to add a bunch of other functions and code to your existing code. Now if you had in mind a slideshow, sure, PX9 might save you in the long run, but for a single logo picture, it's overkill.

  2. Heracleum's own compressor is specialized for low-color images, like B&W. My own picture compressors expect 16-colors and their compression is reflected in this. Heracleum's own gives the best compression with 1-bit images.

So ... yep, there are indeed some advantages, especially for lazy coders such as myself. :)

P#120329 2022-11-08 19:32 ( Edited 2022-11-08 19:33)

Thanks thats helpful.

P#120371 2022-11-09 08:54

@SquidLight sorry I need to experiment more with px9 before replying and make comparisons but as far as I've seen although it handles better multicolour its worst enemy is dithering (and any pixel complexity that breaks a streak of same colour).
It would be interesting to see how different methods work on a same sample image.

P#120373 2022-11-09 09:28

PX9 works fine with simple dithering (e.g. 50%), but it works worse with complicated images, which tend to be dithered.

the way PX9 works, roughly:

  • the decompressor and compressor both start out with an identical prediction dictionary, predicting the color of any pixel based on the neighbors above and to the left.
  • the compressor runs through each row of pixels. when it sees a mispredicted value, (e.g. the dictionary says the next pixel should be red but its actually green), it writes that misprediction to the stream and updates its predictionary
  • when the compressor sees a lot of predicted values in a row, it "writes" those to the stream by just writing a number, telling how many predicted values it saw. this is the main way PX9 saves space!
  • the de-compressor reads the stream, updating the image and keeping its own predictionary in sync with the compressor's. it can do this perfectly because it knows the image up to that point (and because it knows how the compressor works)

so, PX9 does well with images that have a lot of the same color in a row (well, on multiple rows) because it can easily predict what the next pixel will be after the first one. but it can do fine on other more complex inputs as well -- images that have a predictable structure, but not necessarily single-color runs.

>It would be interesting to see how different methods work on a same sample image.

agreed! ping me if you ever dig into this, I'd be interested to see what you find. I'd expect PX9 to perform pretty badly on images with a lot of antialiasing, or images produced from an image converter (instead of hand-drawn pixel-by-pixel)

P#120578 2022-11-13 02:25

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 13:59:18 | 0.045s | Q:24