Today I had something of an epiphany, so I decided to write a utility script that converts images into hex code for the TI-83+/84+ (SE). At the moment it only supports full-screen images, but there's nothing to stop it from doing other sizes. I'm also thinking about '.8xi' exportation.

However, the code as it stands can be found on my BitBucket. Currently, it pastes the code into a .txt file so you can insert it into your editor of choice (TokenIDE is an example I have included).

Enjoy using it and feel free to use the code, providing you give me credit.
This sounds like a neat script, though based on the description, I'm not sure why someone would use this if they're already using TokenIDE, since it can do this already.
Oh really? I haven't got one of the most up to date versions. Never mind. I'm sure I can find plenty of other uses, plus plenty more are in the pipeline Smile

EDIT:
Is anyone good with PicArc. My calculator won't seem to display the image from this code:

Code:
identity(5,"A8000001000400AA00000000A50807010002225A00200000B40253C9400500AA00000000921003E1292A402C00400000D48403E10001002A00000000500093B90004005400400000AA8803F90002001A10000000A80443ED4004005440400000D5010B7E00020029A0000000501403DF0004001680A00000AA8001F7D142801540000000D00849FFEEBD50EE80400000550101DDBBCB555A80200000A88801FFFF75ABEA80800000D40024EFFDDEEEBD002AAAAA524A01BDEF6B57D501549100A88041FFFDFDFAFD00AA4A55D40409F7BFAF575600AAA940524000FFFFFDFFFB0055552AA90920FFEDBFDAAD07555490D4040276FFEFFFF6FA8B55455480087FFFFEEF5B2BE56A20AA1422FFDAFBFDEDD551554AD4400DFDFFEFF7BB5EFC521069045FDFFFFFBFED55AB2944B400BB7F6BBFFABBA0005410AA4A7FFDFFFFDFED49042AA2B403FBF7FEFEF7B6D4A94494D555EFDFDFFBDDEBAB56B552680FFF7FFB6FF727D5BAD555F52FBFFF7DBFFF9D6AD76FBBDA3DFBFFF6DFAD57CAB5B56DE93FFFBDDD7FFF7EA0955BB6BA77FEFFFFDDFBFFD40AAD5BE95FB7FFF7FFEF6ACA8152EDF47FFFF77F77FDFF69542A96BB7EFFDFEDEEFFABAA529551EC7FFDFFFF9BEBFD55AAA22DF07BF7FF7DE5FEABAD555942A56FFFBDFEA3FBF2B5555554803FDFFFDB45EEAAAB6AAAAA54BFFEFFF791FB7004B6D555027EFFEEDA84DEA96BD35B55B4BFFBF7A9217BF0155D6AAA4ABBEF7E94943E0361AAAD6DAB7FFFE75522AC855A5DEB5555DF7EFD529450056FAAB5B53EFFF7DBA4AA94152ADD6ED595B7DEED954A41175D56D35AEEDEFFF45221240DEADAEDD75B7FFF5B49549037EF6D556AEDDBF7FA2480001FF9B6F7ADB6EFBEDD922400AFFEDDA96BDB7FFFFF5100809FEFA2D7AA6FABFBEDAA2202FFBFC3756BDAFEFF7FF10812DFFF41ABAAB75BFFFFDC800BEFFEC2F6D7DAEFDFFB76A0B6B5FC0355AABF7B7FFFFB94AF557511EEEDEADDFBDEEED7BAD6BC4175ABBFB7EFFFFFBADD555589ABD6D57ABFFFFBEFFB55AAA2EEBBBDDFFF7BBF7EFD5555586BCDEB6AD5EFEDFFD5AAAA8536F7",0,0,64,96,3,0,1
merthsoft wrote:
This sounds like a neat script, though based on the description, I'm not sure why someone would use this if they're already using TokenIDE, since it can do this already.
And SourceCoder, but I believe I pointed out Tokens' and SC3's ability to do this back when Electronics started the project, and he wanted to complete it for academic purposes. Smile I could be wrong on that.

Regarding that section of code, what happens when you run it?
KermMartian wrote:
And SourceCoder, but I believe I pointed out Tokens' and SC3's ability to do this back when Electronics started the project, and he wanted to complete it for academic purposes. Smile I could be wrong on that.

Most definitely! However, I'm quite sure this code could have many other uses for calculator programs and other graphics programs.
KermMartian wrote:
Regarding that section of code, what happens when you run it?
The calculator crashes and resets the RAM.
ElectronicsGeek wrote:
Is anyone good with PicArc. My calculator won't seem to display the image from this code:

Code:
identity(5,"A8000001000400AA00000000A50807010002225A00200000B40253C9400500AA00000000921003E1292A402C00400000D48403E10001002A00000000500093B90004005400400000AA8803F90002001A10000000A80443ED4004005440400000D5010B7E00020029A0000000501403DF0004001680A00000AA8001F7D142801540000000D00849FFEEBD50EE80400000550101DDBBCB555A80200000A88801FFFF75ABEA80800000D40024EFFDDEEEBD002AAAAA524A01BDEF6B57D501549100A88041FFFDFDFAFD00AA4A55D40409F7BFAF575600AAA940524000FFFFFDFFFB0055552AA90920FFEDBFDAAD07555490D4040276FFEFFFF6FA8B55455480087FFFFEEF5B2BE56A20AA1422FFDAFBFDEDD551554AD4400DFDFFEFF7BB5EFC521069045FDFFFFFBFED55AB2944B400BB7F6BBFFABBA0005410AA4A7FFDFFFFDFED49042AA2B403FBF7FEFEF7B6D4A94494D555EFDFDFFBDDEBAB56B552680FFF7FFB6FF727D5BAD555F52FBFFF7DBFFF9D6AD76FBBDA3DFBFFF6DFAD57CAB5B56DE93FFFBDDD7FFF7EA0955BB6BA77FEFFFFDDFBFFD40AAD5BE95FB7FFF7FFEF6ACA8152EDF47FFFF77F77FDFF69542A96BB7EFFDFEDEEFFABAA529551EC7FFDFFFF9BEBFD55AAA22DF07BF7FF7DE5FEABAD555942A56FFFBDFEA3FBF2B5555554803FDFFFDB45EEAAAB6AAAAA54BFFEFFF791FB7004B6D555027EFFEEDA84DEA96BD35B55B4BFFBF7A9217BF0155D6AAA4ABBEF7E94943E0361AAAD6DAB7FFFE75522AC855A5DEB5555DF7EFD529450056FAAB5B53EFFF7DBA4AA94152ADD6ED595B7DEED954A41175D56D35AEEDEFFF45221240DEADAEDD75B7FFF5B49549037EF6D556AEDDBF7FA2480001FF9B6F7ADB6EFBEDD922400AFFEDDA96BDB7FFFFF5100809FEFA2D7AA6FABFBEDAA2202FFBFC3756BDAFEFF7FF10812DFFF41ABAAB75BFFFFDC800BEFFEC2F6D7DAEFDFFB76A0B6B5FC0355AABF7B7FFFFB94AF557511EEEDEADDFBDEEED7BAD6BC4175ABBFB7EFFFFFBADD555589ABD6D57ABFFFFBEFFB55AAA2EEBBBDDFFF7BBF7EFD5555586BCDEB6AD5EFEDFFD5AAAA8536F7",0,0,64,96,3,0,1

The 94 and 62 should be multiples of 8. A 1 would be the equivalent of 8 pixels.
Only the width should be a multiple of 8, by the way:
DCS wiki wrote:
Spr_Width: Sprite width in bytes. An 8-pixel-wide sprite is 1 bye wide , 16 pixels wide is 2 bytes, and so on.
Spr_Height: Sprite height in pixels
Will it allow decimal numbers?
ElectronicsGeek wrote:
Will it allow decimal numbers?
Integers only. Your sprites have to be a multiple of 8 pixels. The LCD is 96 pixels wide and 64 pixels high, which happen to be nice multiples of 8.
ElectronicsGeek wrote:
Oh really? I haven't got one of the most up to date versions.

It's done this for years. A sprite editor is one of the first tools I added. The only reason I mention this, Kerm, is because he mentions TokenIDE in the post. He does not mention source coder.

Still a fun project to work on; I certainly am not trying to discourage completion. Just pointing out that tokens users are unlikely to need this while working in tokens.
More changes!

I added some failsafe code along with the ability to resize images to whatever dimensions you require providing they fit the calculator's screen dimensions.

Check it out...
More changes!

You can now generate PicArc code with the hex data encapsulated within it.

Check it out...
BUMP!

A nice image of what TImage does and its results.
Nice job. Smile Did you do the dithering yourself before passing the image to TImage, or did your program do it? If your program did the dithering, I'd be interested in what algorithm you used, as that seems like an option that SourceCoder should provide for its image conversion.
The program did the dithering. PIL has a function which converts an image into mono, however I don't know how that works exactly.
ElectronicsGeek wrote:
The program did the dithering. PIL has a function which converts an image into mono, however I don't know how that works exactly.
Ah, okay. In SourceCoder, the average intensity (R+G+B)/3 of each pixel is computed independently, and then rounded all the way down to black or up to white. I suspect dithering is not something that every user would want, but at least some would appreciate it. This especially goes for the color conversions, since SourceCoder tends to do a poor job with big swaths of color that are not close to any of the 15 OS palette colors (tifreak8x can certainly vouch for this).
Just found this on StackOverflow. Perhaps I could employ some of these techniques to convert the images if the user wanted a different effect.

There's probably some good algorithims there for you to use as well, Kerm.
Another major update to TImage has arrived!



TImage now supports GUIRLargeSprite widgets which can be pushed onto the Doors CS GUI stack.

Check it out...

In the next few updates, I think I need to work on cleaning the code up a bit and adding the option to use different B&W conversion algorithims for different effects. I should probably work on .8xi support one of these days too.
BUMP!

More progress in the form of a new B&W algorithm:

It just gives you a bit more flexibility in how you choose to convert your images, because dithering isn't really suitable for everything.

Check it out...
  
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