# RR,GG,BB Raw Data images

Dec 18, 2013, 18:04
Post: #1
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RR,GG,BB Raw Data images
Hi folks, this is my first thread, although I have been a GIMP user for several years. No extensive knowledge, however, I get by.

I have a slight issue at the moment with an image file I'm trying to create. Basically I have an LED curtain with 15 LED's going along the top, and 11 LEDs going down (165 LED's).

The images that display in this LED curtain are saved as *.bin.bin files. And using a Hex editor and GIMP I've managed to open the files to display on my computer screen. The opened image is tiny, and in size is 11 pixels across and up to 6000 pixels down.

Now imagine this complete image as a filmstrip (but going down instead of across), and each frame is 11 pixels x 15 pixels, with a 2 pixel spacer (which is black) between frames, and this process repeats itself throughout down the image.

In a Hexeditor, the image is opened and after a fidget, is displayed in it's raw format, with the settings RR,GG,BB RR,GG,BB... so on so forth. Each RR,GG,BB is representative of 1 pixel (or LED) of the image. So, there's 11 x rr,gg,bb's across the top, and 300 trillion going down.

Through trial and error, I have managed to create my own animations for this LED cloth in GIMP, but cannot get them to work via GIMP, but I can if I manually edit via the HEX editor. Which works, but is extremely time consuming as you're working with individual pixels at any given time.

When I go to export my finished image, and save it is rr,gg,bb, I do not have that option. All I get is Standard: R,G,B or Planar: RRR,GGG,BBB with indexed Pallette Type: R,G,B (Normal) and B,G,R,X (bmp style).

I have tried all configurations of this export to get my rr,gg,bb raw data file exported to work, and even in the HEX Editor it's way below the 11 px, and instead about 6 or 7 px.

Is there a plugin, or configuration that will save my image as RR,GG,BB?

I'm sorry I've waffled on a bit, but thought I'd give a good detail of my situation.

Please feel free to ask about my images/files/application. I'll be more than happy to share files so you folks can have a first hand look.
Dec 18, 2013, 19:13 (This post was last modified: Dec 18, 2013 19:39 by RobbieK..)
Post: #2
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
Just to add, when viewing the original images in a HEX Editor, there is no header. The patterns anf actual image can be seen made up in the Hex viewer.

Image opened in Hex Editor

In, GIMP, open image as Raw Data

The image when first opened is 350 x350, here I changed it to 11 x billions

And here is a small section (2 frames) of the image opened in Gimp displaying the correct colours that display on the LED cloth. Can you see the similarities in the Hex Editor pic?
Dec 18, 2013, 20:05
Post: #3
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
I would be willing to write you an in/out translator if you need, one that takes the .BIN and converts to a .BMP for editing, and then back to .BIN.
Dec 18, 2013, 20:17
Post: #4
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
(Dec 18, 2013 20:05)foxmuldr Wrote:  I would be willing to write you an in/out translator if you need, one that takes the .BIN and converts to a .BMP for editing, and then back to .BIN.

That sounds very interesting, I'd like to think that idea works. Would you like a copy of an original image o play with? It's small in size.
Dec 18, 2013, 20:22 (This post was last modified: Dec 18, 2013 20:24 by foxmuldr.)
Post: #5
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
Sure.

I can also put more images side-by-side if you'd like so the image isn't 11x6000, but instead is something like 220x300 with a space between each strip, so it would be slightly larger than 220x300, but would break out portions for the 11x15 frame size more clearly. I could also rotate it 90 degrees automatically if that would make it more clear, etc.

Send the sample in email. Are you using Windows? Or some other OS?

Syntax would be something like:
bin2bmp -in:file.bin -out:file.bmp
bin2bmp -in:file.bmp -out:file.bin
Dec 18, 2013, 20:28
Post: #6
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
(Dec 18, 2013 20:22)foxmuldr Wrote:  Sure.

I can also put more images side-by-side if you'd like so the image isn't 11x6000, but instead is something like 220x300 with a space between each strip, so it would be slightly larger than 220x300, but would break out portions for the 11x15 frame size more clearly. I could also rotate it 90 degrees automatically if that would make it more clear, etc.

Send the sample in email. Are you using Windows? Or some other OS?

Syntax would be something like:
bin2bmp -in:file.bin -out:file.bmp
bin2bmp -in:file.bmp -out:file.bin

Windows 7 and the latest version of GIMP. I had Windows 8 for a total of 3 hours. 1's and 0's later back to a semi decent OS. I'll pop a file in email for you as soon as.
Dec 18, 2013, 20:33
Post: #7
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
It also wouldn't be hard to write a native generic editor for this file if you'd like. I assume you're putting colored pixels at various locations, then copying from that frame forward to the next, then editing, repeating for however long the "filmstrip" is?
Dec 18, 2013, 20:41
Post: #8
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
(Dec 18, 2013 20:33)foxmuldr Wrote:  It also wouldn't be hard to write a native generic editor for this file if you'd like. I assume you're putting colored pixels at various locations, then copying from that frame forward to the next, then editing, repeating for however long the "filmstrip" is?

Yeah, alot of that, and also scrolling text etc. I'm currently trying to create a 'Merry Christmas' followed by falling snow image for my application. Successfully made a gif of it, got it into gimp and made a film strip with the necessary parameters. All's fine, just the export thing that's knocking me about, well I think anyway.
Dec 18, 2013, 20:47 (This post was last modified: Dec 18, 2013 20:51 by foxmuldr.)
Post: #9
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
If you save the animated GIF as a series of BMP images with a sequential numbering sequence, I could add a feature of bin2bmp to merge in that file at a starting frame number. The "-insert" would inject them in the middle, rather than overwriting.

Syntax:
bin2bmp -in:file.bmp -merge:c:\path\to\images\filePattern###.bmp -insert -frameStart:N
Dec 18, 2013, 20:54
Post: #10
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
All sounds good. That'll definitely solve my problems.
Dec 18, 2013, 21:45
Post: #11
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
(Dec 18, 2013 21:06)ofnuts Wrote:  Gimp can save to very raw formats... At the bottom left of the export dialog, there is a "Select file type" drop down, with a "Raw image data" selection...
Thanks for your reply, I have tried all the options and Raw Image Data is certainly the file I want. However, the options after that selection limit me to only 2 options of the type, for instance, I need 'RR,GG,BB', not 'R,G'B or RRR,GGG,BBB and the other variant, B,G,R X.

The closest I've gotten to success is using the R,G,B Standard, and selecting B,G,R,X Bitmap. It sort of keeps the file in it's proper places when viewing from the Hex editor, but creates the fault that it's the wrong way around. So will not work for my application.

I'm guessing the image itself may be 8bit, but I'm not too clued up in that aspect, opening it up from it's raw element asks as many questions as it answers. if only there was a RR,GG,BB 'put back the way you found it' option
Dec 19, 2013, 14:04 (This post was last modified: Dec 19, 2013 14:13 by foxmuldr.)
Post: #12
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
I should complete the conversion portion tonight (bin to bmp, bmp to bin) with these options:
bin2bmp -in:file.bin -out:file.bmp [-wide:N]
bin2bmp -in:file.bmp -out:file.bin
bin2bmp -in:file.bin -preview:N
bin2bmp -in:file.bmp -preview:N

-wide:N will put that many frames side-by-side so they are edited more easily. When going back from BMP to BIN it will automatically know how wide it is.

I'll leave off rotation since GIMP can do that easily. It should be in standard form when converting back though, with frames aligned:
Code:
1  2  3  4 5  6  7  8 9  ... and so on

-preview:N will display the strip with an N millisecond pause between each one (-preview:33 will show 30 frames per second, for example).

It will create a 32-bit bitmap with an alpha channel showing the frame between each slide. I'll leave off the two blank pixel rows for the BMP version. You can just deal with real slide pixel data. Then I'll automatically insert them back in for the .bin file. It will wind up looking like the attached image.

Attached File(s) Thumbnail(s)

Dec 19, 2013, 14:24
Post: #13
 RobbieK. Junior Member Posts: 20 Joined: Dec 2013 Reputation: 0
RE: RR,GG,BB Raw Data images
Looks and seems like it should do the trick. Can't wait to try it out. Thank you very much for your help, it's really appreciated.
Dec 20, 2013, 12:46
Post: #14
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
I didn't get a chance to work on it last night. But, today (prayerfully). :-)
Dec 20, 2013, 20:41 (This post was last modified: Dec 21, 2013 02:27 by foxmuldr.)
Post: #15
 foxmuldr Member Posts: 65 Joined: Sep 2013 Reputation: 2
RE: RR,GG,BB Raw Data images
I believe this version handles .bin files properly, and generates the 32-bit .bmp files properly, and vice-versa. The -wide:N option works, as does -preview:N.

Usage:
Code:
bin2bmp -in:c:\path\to\file.bin -out:c:\path\to\file.bmp -wide:4 bin2bmp -in:c:\path\to\file.bmp -out:c:\path\to\file.bin bin2bmp -in:c:\path\to\file.bin -preview:100 bin2bmp -in:c:\path\to\file.bmp -preview:100

The "-wide:4" portion is optional. If you do not specify, it will be 12 pixels wide (with the zero alpha value pixel border there). The "-preview:100" will display a little preview window with that many milliseconds between frames. Close the preview window to exit the app.

Please test it and report any bugs.

Attached File(s)