I have code which creates jpg image from hexadecimal string. The generated jpg image having 32 bit depth but i want to make it 24 bit. Is it possible to change the bit depth without imagemagick ??
Here is the code to generate JPG Img :
$hexstring = XXXXXXX;
if(is_string($hexstring) && !empty($hexstring))
{
$hex='';
for($a=0; $a<strlen($hexstring); $a+=2)
{
$hex.=chr(hexdec($hexstring{$a}.$hexstring{($a+1)}));
}
$fileHandle= fopen($imgFile, 'w+');
fwrite($fileHandle,$hex);
fclose($fileHandle);
}
Thanks