Author Topic: How to easely convert .bmp to a binary 'picture' so it can be used in a script?  (Read 5176 times)

0 Members and 1 Guest are viewing this topic.

Offline Jerros

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 137
  • Rating: +9/-0
    • View Profile
Might need to explain what I mean here;
what's a conveniet way to create big 'pictures' for a programm?
This is what we want in the case of a full 96x64 pic:
Code: [Select]
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11001111b, 11111111b, 11111111b, 10011111b, 11111111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001111b, 11111111b, 11111111b, 10011111b, 11111111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001111b, 11111111b, 11111110b, 00000111b, 11111111b
.db 11111111b, 11111110b, 11111111b, 11111111b, 11111111b, 11111111b, 11111110b, 00001111b, 11111111b, 00000000b, 00000000b, 00011111b
.db 11111111b, 11111100b, 11111111b, 11111111b, 11111111b, 11111111b, 11111100b, 00001111b, 11111111b, 00000000b, 00000000b, 00111111b
.db 11111000b, 00000000b, 00000000b, 01111111b, 11111110b, 00000111b, 11111000b, 00001111b, 11111111b, 00000000b, 11100000b, 01111111b
.db 11111000b, 00000000b, 00000000b, 11111111b, 11111110b, 00000011b, 11110000b, 00001111b, 11111111b, 00000000b, 11100000b, 01111111b
.db 11111000b, 00000000b, 00000001b, 11111111b, 11110000b, 00000001b, 11100000b, 00001111b, 11111111b, 00000001b, 11110000b, 11111111b
.db 11111000b, 00000111b, 00000011b, 11111111b, 10000000b, 00000001b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00000111b, 00000011b, 11111110b, 00000000b, 00000001b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11001111b, 11110000b, 00001110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11000000b, 00001110b, 00000001b, 11111000b, 00011111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 10000000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111100b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111100b, 00000001b, 11111111b, 11111111b
.db 11110000b, 00001111b, 11111111b, 11110000b, 00001110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11110000b, 00001111b, 11111111b, 11110000b, 00000000b, 00000011b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00110000b, 00000011b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11000111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 10000111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11000011b, 00000001b, 11100001b, 11111111b
.db 10011000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 10000111b, 00000000b, 11100000b, 11111111b
.db 10101000b, 00001111b, 10001111b, 11000000b, 00001110b, 00000001b, 11111000b, 00000011b, 00000011b, 00000000b, 11000000b, 01111111b
.db 10011000b, 00001111b, 00000111b, 11111010b, 00001110b, 00000011b, 11111000b, 00000000b, 00000011b, 00000000b, 00000000b, 01111111b
.db 10101000b, 00000111b, 00000011b, 11111111b, 11111110b, 00000001b, 11110000b, 00000000b, 00000011b, 00000000b, 00000000b, 01111111b
.db 10011000b, 00000110b, 00000011b, 11111111b, 11111110b, 01101111b, 11100000b, 11111100b, 00110011b, 00000000b, 00100000b, 01111111b
.db 11111000b, 00000000b, 00000011b, 10111111b, 11111111b, 11111111b, 11001111b, 11111111b, 11111111b, 00000111b, 11110000b, 11111111b
.db 10101000b, 00000000b, 00000011b, 11000000b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 00000111b, 11111111b, 11111111b
.db 11011000b, 00000011b, 00000011b, 11000000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000111b, 11111111b, 11111111b
.db 11011000b, 01111111b, 10000011b, 11000000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111001b, 11000111b, 11111111b, 11111111b
.db 11111011b, 11111111b, 10001111b, 11000000b, 01111110b, 01111100b, 00000000b, 00111111b, 11100000b, 11100011b, 11111111b, 11111111b
.db 11111111b, 11111111b, 00001111b, 11000000b, 01111110b, 00111110b, 00000000b, 00011111b, 10000000b, 00111000b, 11111111b, 11111111b
.db 11111111b, 11111110b, 00011111b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000000b, 00001110b, 01111111b, 11111111b
.db 10011111b, 11111100b, 00111111b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000000b, 00000011b, 01111111b, 11111111b
.db 11011111b, 11111100b, 01111111b, 11000000b, 11000001b, 00000011b, 00000111b, 10001110b, 00000111b, 00000011b, 10111111b, 11111111b
.db 11011111b, 11110001b, 11100011b, 11000000b, 11000001b, 11100011b, 00000111b, 10001110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 10011111b, 11100001b, 11100011b, 11000000b, 11000001b, 11000011b, 00000111b, 10001110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 11111111b, 10011111b, 10000011b, 11000000b, 11000001b, 11000011b, 00000110b, 00000110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 10011111b, 11111111b, 00000011b, 11000000b, 11000001b, 11000011b, 00000100b, 00001110b, 00000111b, 00000011b, 11011111b, 11111101b
.db 10111111b, 11111110b, 00000011b, 11000000b, 11000001b, 11000011b, 00000000b, 00011110b, 00000111b, 00000011b, 10001111b, 11111000b
.db 10011111b, 11111100b, 00000011b, 11000000b, 11000001b, 10000011b, 00000000b, 01111000b, 00000111b, 00000011b, 10001111b, 11111000b
.db 10111111b, 11111000b, 00000011b, 10000000b, 11000000b, 00000011b, 00000000b, 01111000b, 00000111b, 00000011b, 10001101b, 11011000b
.db 10011111b, 11111110b, 00000000b, 00000000b, 11000000b, 00011111b, 10000000b, 00111110b, 00000111b, 00000001b, 10001000b, 10001000b
.db 11111111b, 11111110b, 00000000b, 00000000b, 11000000b, 00111111b, 00000000b, 00111110b, 00000111b, 00000000b, 10001000b, 10001000b
.db 10011111b, 11111110b, 00000000b, 00000000b, 11000000b, 11111111b, 00000100b, 00111110b, 00000111b, 00000011b, 10001000b, 10001000b
.db 10101111b, 11111110b, 00000111b, 11000000b, 11000001b, 11111011b, 00000100b, 00011110b, 00000111b, 00000011b, 10001011b, 11001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 01000001b, 11100011b, 00000110b, 00011110b, 00000111b, 00000111b, 10001110b, 01001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11000001b, 00000011b, 10000111b, 00001110b, 00000111b, 00000111b, 10001100b, 01001000b
.db 11111111b, 11111110b, 00000011b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000111b, 00000011b, 10011000b, 01001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 11111000b, 00011111b, 00000111b, 10001110b, 00000111b, 00000011b, 10110000b, 11001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11111110b, 00011111b, 00000111b, 10001110b, 00000111b, 00000111b, 11100001b, 10001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 11111110b, 00111100b, 00000001b, 10001110b, 00000111b, 00000011b, 11000011b, 10001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11111111b, 01111111b, 11111111b, 11000111b, 11000000b, 00000011b, 10000110b, 10001000b
.db 11111111b, 11111110b, 00000011b, 11000000b, 11111111b, 11111111b, 11111111b, 11000011b, 11100000b, 00000111b, 10001100b, 10001000b
.db 10001111b, 11111110b, 00000011b, 10000000b, 01111111b, 11111111b, 11111111b, 11110001b, 11110000b, 01111111b, 10011000b, 10001000b
.db 10101111b, 11111110b, 00000011b, 00000000b, 00111111b, 11111111b, 11111111b, 11111000b, 11111000b, 11111111b, 10011101b, 11011000b
.db 10001111b, 11111110b, 00000011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111110b, 00111001b, 11111111b, 10011111b, 11110000b
.db 11111111b, 11111110b, 00000011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001110b, 00000000b
.db 10001111b, 11111100b, 00000001b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000011b, 00000000b
.db 10111111b, 11111000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000001b, 00000000b
.db 10001111b, 11110011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000001b, 00000001b
.db 11101111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11000011b, 00000011b
.db 10001111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11100110b, 00000111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b
But after designing a screen of some sort, is there an easy way to quickly turn a .bmp file or something into something suitable for programming use, like the above example? I'm getting tired of manually typing this shit, it's a monk's job!

Thanks in advance!


79% of all statistics are made up randomly.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
I believe SourceCoder can convert .bmps to binary data and/or hex.

http://www.cemetech.net/projects/basicelite/sourcecoder2.php

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
If you are using SPASM, you can import a .bmp directly by using #include "filename.bmp"
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline KermMartian

  • Editor
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 500
  • Rating: +233/-20
    • View Profile
    • Cemetech
I believe SourceCoder can convert .bmps to binary data and/or hex.

http://www.cemetech.net/projects/basicelite/sourcecoder2.php
SourceCoder 2.5 can indeed convert images into .8xi format as well as binary format for ASM, BASIC, and Axe in monochrome and 3- and 4-level grayscale.



Ashbad

  • Guest
^ that's what I use many times to convert my ms-paint sprites to hex.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Much longer discussion here: http://ourl.ca/8027

Basically, yeah, use SourceCoder. It shows whatever formats you need :) And 8xi's.




Offline Jerros

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 137
  • Rating: +9/-0
    • View Profile
Wow, thanks y'all! That should definitely save me some time. =^_^=


79% of all statistics are made up randomly.