Hello to the whole community!
This is my first post, so the first thing i have to do is saying hi to everyone 😉
Now back on subject: i'm trying to convert a set of scripts i made using the GD library, used to merge different images together transforming the RBG white (255,255,255) into a transparent color.
What i'd need to do is:
1) Store images in Mysql (not in files);
2) Find a way to set RGB white as transparent;
3) Use imagemagick to work with them (GD gave me troubles because different versions behaves differently);
With GD points 1 and 2 was not difficult: pratically i did:
$source_create=imagecreate($dest_x,$dest_y);
imagecolortransparent ($source_create,imagecolorallocate ($source_create, 255, 255, 255));
$source_id = imagecreatefromstring($source_data);
imagecopyresized($source_create,$source_id,0,0,0,0,$dest_x,$dest_y,$resources_w,$resources_h);
imagecopymerge($target_id,$source_create,0,0,0,0,$dest_x,$dest_y,100);
But this doesn't work everywhere, expecially if i try to work with truecolor images with GD2 using imagecreatetruecolor.
I'd like to do this thing using magick, but i was not able to understand how to set the RGB white as transparent and, more important, how to use raw data i have in database with it.
Finally, to make all harder, i'd need to use the commandline exec function, because i cannot be sure i'll have magick php modules installed everywhere, so i'd prefer to require only imagemagick installed.
Any suggestion?