Yes it is possible. You can define an area in the image, fill it with a color and then set that color as transparennt. It requires the availability of the GD libraries. The respective manual for the command has this code in the example:
<?php
// Create a 55x30 image
$im = imagecreatetruecolor(55, 30);
$red = imagecolorallocate($im, 255, 0, 0);
$black = imagecolorallocate($im, 0, 0, 0);
// Make the background transparent
imagecolortransparent($im, $black);
// Draw a red rectangle
imagefilledrectangle($im, 4, 4, 50, 25, $red);
// Save the image
imagepng($im, './imagecolortransparent.png');
imagedestroy($im);
?>
In your case, you would take an existing image with the respective function. the resulting resource would be the $im in the above example, you would then allocate a color, set it transparent and draw the rectangle as above, then save the image:
<?php
// get the image form the filesystem
$im = imagecreatefromjpeg($imgname);
// let's assume there is no red in the image, so lets take that one
$red = imagecolorallocate($im, 255, 0, 0);
// Make the red color transparent
imagecolortransparent($im, $red);
// Draw a red rectangle in the image
imagefilledrectangle($im, 4, 4, 50, 25, $red);
// Save the image
imagepng($im, './imagecolortransparent.png');
imagedestroy($im);
?>