I am watermarking JPGs with PNGs and then displaying them to users. I’m using a combination of PIL and OpenCV to create the watermark and then applying the watermark to the JPG. I was surprised to find that it took 1.5s from start to finish. I assumed that the bottleneck would be the graphics operations, but after timing every single line, I found that saving the watermarked JPG to SSD was the biggest culprit - 0.7s to 1s to save about 700kb images. I tried saving the image to memory in a BytesIO object, but that takes longer (1-1.5s).
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.