Jump to content

ejohnson0547

Newbies
  • Posts

    2
  • Joined

  • Last visited

ejohnson0547's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. You have to remember the 565 format is very strange. Going from 24 bit to 565 is simple, but the reverse is not. Take white for instance in hex its FFFFFF. Converting it to 565 format you get FFFF. Looking at the bits you get RRRRRGGGGGGBBBBB. You can't simply insert 0's to get RRRRR000GGGGGG00BBBBB000. That would be F8FCF8. You would lose all the whites. Some call this the naive conversion. There are two better ways. If you can think of R5 as the 5 bits of red and R8 as the full 8 bit red R8 = R5 * 255 / 31 Or R8 = (R5 << 3) | (R5 >> 2) For Green it would be: G8 = G6 * 255 / 63 Or G8 = (G6 << 2) | (G6 >> 4) The second formula seems to be the one this is using. It simply replicates the higher bits into the undefined lower bits. My code is simply calling the standard C# functions to load a bitmap in the RGB565 format. bitmap = new Bitmap(width, height, 2 * width, System.Drawing.Imaging.PixelFormat.Format16bppRgb565, scan0);
  2. This plugin will read and write to the RGB565 or RAW565 format. This format is used by the Android platform for the initial boot screen of the device. It will also allow you to open a BMP, PNG, JPG or other image, then save it as a RGB565 file. RGB565 is simply the raw pixel data of a bitmap file. It does not contain any header information and does not contain the dimensions of the image. The only thing that is known is the total number of pixels. When opening a .rgb565 file, the user must specify the height and width of the image. Most of the Android devices today have a 320 x 480 screen. So the rgb565 file for that device will have 153600 pixels. The size of the file in bytes will be twice the number of pixels or 307200 bytes. I have defaulted the height and width to these values when opening a file. When saving a file, your image must already be set to the dimensions you want. (i.e. 320 x 480) Here is the plugin: Rgb565.zip To install this plugin, simply copy the RGB565.dll file to the folder: "C:\Program Files\Paint.Net\FileTypes" or wherever you have Paint.Net installed. Enjoy!
×
×
  • Create New...