New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

All aspects of programming on the Commander X16.
Post Reply
CursorKeys
Posts: 82
Joined: Tue Jan 12, 2021 9:52 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by CursorKeys »




MR TUTH - HIRES DOUBLE PETSCII DEMO




View File






This is my second "Double PETSCII" demo.

But this time around, the screen resolution is higher, and

it is not hand designed PETSCII pictures, but instead it is an imported picture.

Besides PETSCII, there is also a scrolling effect, and a wavey effect.

The demo is written in KickC, and the PETSCII editor is once more the

alfa version of HyperPetscii.

The link to this can be found here: https://hyperpyxel.com/?p=229

Note: It is still pretty unstable and does not work well on a browser in the MAC for some reason.

If you cannot run it on an emulator, you can see it on youtube here: https://youtu.be/kwLtU9fACpE

Keep cool, and keep it PETSCII.






 
Ed Minchau
Posts: 508
Joined: Sat Jul 11, 2020 3:30 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by Ed Minchau »


So can we automatically turn say a random BMP into a double petscii image?

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by Scott Robison »



1 hour ago, Ed Minchau said:




So can we automatically turn say a random BMP into a double petscii image?



I don't think anyone has created a generic utility that attempts that yet, though maybe one was used in creating this demo.

Ed Minchau
Posts: 508
Joined: Sat Jul 11, 2020 3:30 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by Ed Minchau »



3 hours ago, Scott Robison said:




I don't think anyone has created a generic utility that attempts that yet, though maybe one was used in creating this demo.



It looks like I'm going to have to use something like the double petscii technique to do video on the X16. A utility that converts 8x8 pixels into 4 bytes with 3 colors might be very useful.  And of course we can use any tile, not limited to petscii, and can flip vertical and horizontal. 

User avatar
Yazwho
Posts: 172
Joined: Fri Feb 19, 2021 2:59 pm
Contact:

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by Yazwho »


It might be easier to do this on your dev machine rather that on the C16 itself.

For example I have a c# app that converts a PPM file into tiles\map asm files. It can be dropped into the build chain, makes life much easier.

CursorKeys
Posts: 82
Joined: Tue Jan 12, 2021 9:52 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by CursorKeys »



15 hours ago, Ed Minchau said:




So can we automatically turn say a random BMP into a double petscii image?



Hi!  Indeed, I have some code for doing just that.  Only one frame.  No optimization yet to do a whole bunch of frames on one button click.

The code is not CX16 compatible though, you need to run it from your browser, since it's in javascript.  I have a whole folder with double petscii images waiting for a next demo.  Haven't gotten to it, since a non compressed hires double petscii picture, is quite large (20kb), and I only managed so far to put a single one in a prg file.  (See my previous thread posting)



Anyway the code is not yet public, but will be pretty soon.

CursorKeys
Posts: 82
Joined: Tue Jan 12, 2021 9:52 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by CursorKeys »


A few more words about converting bitmaps to (double) PETSCII.



Alot of effort goes into finding the right settings, for just that picture.  Alot of bitmaps, don't work very well, while some work very well.  It has to do with 4 things.



1. Mapping bitmap colors to 16 color palette.  Sometimes you need to tweek the contrast, and sometimes the saturation, and sometimes a magic combo works.  But sometimes it just won't work, and some preprocessing will do the trick.  Low contrast pictures are harder then hi contrast pictures.



2. Dithering can make a picture look better, but dithering can be done in several ways.  Best it seems when 1 part of the picture has dither and another part does not.   The mrTuth demo uses no dithering. (It was really on the flip of a coin which of the  two pictures I liked best, with or without dither)



3. Finding the best matching characters, to each 8x8 bitmap subarea area.  This is a bit like "magic", since there are multiple possible solutions, and which is the best one?  My algoritm just takes one solution for a single layer. Then another algoritm for the second (double petscii) layer, to see if it can improve on the original solution. I have a better algoritm in mind, but not yet implemented.

4. Hires vs Lores.  A hires double petscii resolution is easier as a target for a bitmap picture. Since even if the conversion is not perfect, the resolution makes somewhat up for it.



So whatever tools you develop, you probably need a whole bunch of settings as input, or alternatively implement some AI, to find the best settings for you ?



Ok, more about this later, when I make the tool publicly available.



-CC

Ed Minchau
Posts: 508
Joined: Sat Jul 11, 2020 3:30 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by Ed Minchau »


Layer 0 is in 16 color 1bpp mode and layer 1 is in 256 color 1bpp mode, yes?

CursorKeys
Posts: 82
Joined: Tue Jan 12, 2021 9:52 pm

New demo uploaded: MR TUTH - HIRES DOUBLE PETSCII DEMO

Post by CursorKeys »



13 hours ago, Ed Minchau said:




Layer 0 is in 16 color 1bpp mode and layer 1 is in 256 color 1bpp mode, yes?



I think you are right, you can have 1 layer in 256 colors.  But in my demos both layers where 16 colors. (or at least I only used 16 colors in both layers, with standard c64 palette)

Post Reply