I'm trying to create a BMP image in PHP 7 using Imagick which works, but the save quality is always 32 bit, which I don't want. I need to save BMP in 4 bit quality. I do this using $image->setImageDepth(4); which doesn't work. Please advise how to do this?
I tried Imagick and it always gives BMP in 32bit.
To save a BMP image in 4-bit quality in PHP, you can set the image colorspace to GRAY and the image depth to 4.
You can replace the 'yol/oluşturulan/resim.bmp' part with the section where you want to save the BMP image.
Sorry google traslate :)
Update.
In this example, we create an image with a white background and a size of 100x100 pixels. Then, we set the color space to RGB and paint the white pixels black first, and then paint the black pixels red.
Sorry google translate :)