I am in the process of outputting images after working with OpenCV in Print.
I found out that the PCL driver supports transparency but the PS driver does not.
Therefore, the PS driver inquires about the operation.
I print the image on the EndPage of the print. Therefore, the transparency is adjusted using the alpha channel so that the letters are not covered. This is very effective. It makes the image less dark and transparent. Therefore, we use the method of embedding a PNG into the HDC of the print.
However, it seems to be different from the transparency of PCL. If you print a transparent image in PCL, the text becomes transparent so that you can see it in front, but in PS, even if it is transparent, when you print the image, all the text behind it is covered. Therefore, it seems that there is a problem with working with transparent images in PS. Please check the code below and tell me why it looks transparent but hides the text
cv::Mat inputImage = cv::imread(szMulti, cv::IMREAD_UNCHANGED);
cv::Mat bgra[4];
cv::split(inputImage, bgra);
double alpha = 1.0 - ((100 - LogoDensity) * 0.01);
cv::Mat alpha_channel = bgra[3] * alpha; // create a new alpha channel by multiplying the original alpha channel by the transparency level
bgra[3] = alpha_channel; // replace the original alpha channel with the new one
cv::merge(bgra, 4, inputImage); // merge the channels back together
cv::imwrite(szoutputImageName, inputImage, { cv::IMWRITE_PNG_COMPRESSION, 7 });
The image below is printed by dividing one file into PS and PCL.
[PCL]