: What's the easiest way to convert a .jpg image with white background into .png with alpha channel? example .jpg: Ideal .png result:
example .jpg:
Ideal .png result:
More posts by @Angela777
4 Comments
Sorted by latest first Latest Oldest Best
If you use GIMP, I can suggest this tutorial: Perfect masking using a highpass guide.
I had very good results with complex images by following it.
For the sake of completion i had to add one more method (if you using photoshop). As your image is not complex you can use the magic wand, or select color. But best method for separating a complex foreground from a relatively less complex background is Channel masking.
Here is a good tutorial which might be helpful for future visitors: graphics.tutremix.com/tutorials/photo-effect/how-to-make-a-lightning-man-photomanipulation-in-photoshop-day-1/
Command line is quicker. Install Imagemagick.
One file:
convert -transparent white whatever.jpg whatever.png
More files:
Put together a bash script file:
for img in *.jpg; do
filename=${img%.*}
convert -transparent white "$filename.jpg" "$filename.png"
done
Run it and then you will be done. Note that the above will add transparency to everything that is white 'FFFFFF' including any pixels of that colour inside your image. "topLeftPixel" can be used instead of "white" for autodecting background colour.
If the white pixels in image problem is a problem then you can do Photoshop batch. Layer mask is better than 'delete'-clearing the white pixels as you do not actually alter the RGB layers.
It depends on the software you have available to you.
If you have Photoshop, for an image that clean you can do it very quickly:
Open the file.
Double-click the Background layer to convert it to a normal layer.
Use Magic Wand (w) (low Tolerance and Contiguous and Anti-alias checked) to select the white background.
Press Delete key to clear the selection.
Save as a PNG or Save-for-web as PNG.
If you get a white halo around your image, try using menu Select ⇒ Modify ⇒ Expand (with 1-2px setting) after step 3.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.