Recent

Author Topic: TImage and reduced color depth image manipulation  (Read 906 times)

reb

  • New member
  • *
  • Posts: 8
TImage and reduced color depth image manipulation
« on: July 14, 2019, 04:13:58 pm »
Hello,

I want to store monochrome images in TImage class. I have attempted to set Image.Picture.Bitmap.PixelFormat:= pf1bit. Regardless of the pixel format set, values are always stored as 24 bit RGB (it seems like it). At first glance it seems to be not possible because image.Picture.Bitmap.Canvas.Pixels[] always sets and gets TColor.

How can I go about manipulating and displaying 8 bit greyscale and 1 bit monochrome images?
If it is not possible, then how can I use RawImage with ricfGray? Built in documentation didn't help much.

Thank you

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: TImage and reduced color depth image manipulation
« Reply #1 on: July 14, 2019, 05:34:38 pm »
Not sure about Timages but, Tbitmap needs to have the Pixelformat := pf1bit; before you set the
size of it..

 I've never tried that with TImage so I am not sure there.

 Once done, you could covert it to a 24 bit and keep the monochrome look.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018