How would I go about turning an image into a program that draws the image to the graph screen, and is it possible for it to not take 171 Kb of memory?
Edit: preferably for the 84pce
I thought this was an interesting project so I gave it a shot myself. I managed to draw the picture in just 44kb with better resolution.

The graph screen is just 265x165 pixels large. So the first thing I do is resize the image to fit those dimensions.

Next, the TI-84 Plus CE only has 14 color available for the graph screen. So we can quantize the image to only use those specific colors. This doesn't look very good on its own, so we use some dithering to give the illusion of a larger color palette.

Now that we have a picture using only TI-84 Plus CE colors, we need to convert this picture to data the calculator can understand. Each color on the calculator is represented by a number from 10-24.


Code:
#0000ff -> 10 Blue
#ff0000 -> 11 Red
#000000 -> 12 Black
#ff00ff -> 13 Magenta
#009f00 -> 14 Green
#ff8f20 -> 15 Orange
#b62000 -> 16 Brown
#000086 -> 17 Navy
#0093ff -> 18 Light Blue
#ffff00 -> 19 Yellow
#ffffff -> 20 White
#e7e2e7 -> 21 Light Gray
#c7c3c7 -> 22 Medium Grey
#8f8b8f -> 23 Grey
#515551 -> 24 Dark Gray


We could create a string that stores each consecutive color's ID. (e.g. "Blue Green Red Grey" would be converted to "10131223")

Since we know there are 265*165 = 43725 pixels on the graph screen, and each color is represented by 2 numbers, we would need 87kb of data to draw the screen. However, there's a major optimization we can do. Instead of using TI's color IDs, we'll make our own IDs using only a single character. This will halve the required data! This is what I ended up using:

Code:
#0000ff -> 0 Blue
#ff0000 -> 1 Red
#000000 -> 2 Black
#ff00ff -> 3 Magenta
#009f00 -> 4 Green
#ff8f20 -> 5 Orange
#b62000 -> 6 Brown
#000086 -> 7 Navy
#0093ff -> 8 Light Blue
#ffff00 -> 9 Yellow
#ffffff -> B White
#e7e2e7 -> C Light Gray
#c7c3c7 -> D Medium Grey
#8f8b8f -> F Grey
#515551 -> G Dark Gray


This means we only need 43kb of data to draw the same image on the screen. (e.g. "Blue Green Red Grey" would be converted to "041F")

We can make a TI-Basic program to interpret this data, and convert it back to TI's color IDs. This is the code I made. It's extremely slow at drawing (expect to wait 30+ minutes) but gets the job done: http://sc.cemetech.net/?hash=uXIfQh1kLSuqSEYdQ8uAXwGKfF1z
I also made a converter in C# that accepts an image then generates the TI-Basic code to draw the image: https://github.com/TheLastMillennial/SDPictureViewerConverter
[quote="TheLastMillennial"]This means we only need 43kb of data to draw the same image on the screen.
You might be able to go a step further, and theoretically use the different PtOn styles to cover larger chunks of the same color, alternatively using an encryption method:
Use only letters for the colours, and a number before a letter indicates repeating that colour that many times.
Thank you for a starting point though 😁
Also, does the C# program need the image to be pre formatted or does it also do that?
TheLastMillennial wrote:

I also made a converter in C# that accepts an image then generates the TI-Basic code to draw the image: https://github.com/TheLastMillennial/SDPictureViewerConverter

Can you make a converter that generates a Celtic sprite?
If I understand celtic sprites, you should be able to use convimg. https://github.com/mateoconlechuga/convimg
There's 15 colors, so you just need 225 tokens to encode 2 pixels per token. There's something like 241-ish usable 1-byte tokens, so you can chop the size in half once more.
Something like this, but with more tokens and toString (holy cow I wrote this before toString!)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement