Jump to content
You must now use your email address to sign in [click for more info] ×

Convert grayscale image to transparency


Recommended Posts

I have got a number of picture border files in JPG format I need to convert to transparency in PNG format.

I need pure black to become fully opaque, pure white to become 100% transparent and various shades of grey to become various amounts of transparency.

Some of the files are just pure black and pure white. These are easy to convert: Flood select tool on the white, press delete and instant 100% transparency, then export. It's the various shades of grey I am struggling with. Any help gratefully received.

Jonathan

Link to comment
Share on other sites

14 hours ago, Jonathan D said:

I need pure black to become fully opaque, pure white to become 100% transparent and various shades of grey to become various amounts of transparency.

Perhaps see if this post helps

 

Intel i7-10700 Gen10 CPU, 32GB RAM, Geforce GTX 1660 OC 6GB
Windows 10 Pro 22H2, 1x 1TB M.2 NVMe, 1 x 2TB M.2 NVMe. Affinity APh, APu, ADe

Link to comment
Share on other sites

On 11/3/2019 at 6:05 AM, Jonathan D said:

I need pure black to become fully opaque, pure white to become 100% transparent and various shades of grey to become various amounts of transparency.

If you're using Affinity Photo, you might try the following:

  1. Have your image at the bottom of the layer stack, and make sure it's a (Pixel) layer (rasterize it if it isn't).
  2. Place a pure black Fill layer below your image.
  3. Click on the image in the Layers panel, and invert it (Ctrl/Cmd+I (Windows/Mac)).
  4. Right-click on the image in the Layers panel and Rasterize to Mask.
  5. Optional: Then drag it to the mask position of the fill layer, or right-click and Mask to Below.

 

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

See ...

For bulk processing (many images) a tool like ImageMagick might be handy here, assuming an image is a greyscale PNG file then ...

Quote

convert greyscale.png -alpha off -alpha copy -type truecolormatte PNG32:greyscale_alpha.png

... see for ImageMagick and the control of image transparency this here.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

  • 1 year later...

Glad to have helped, @thriva, and welcome to the forums.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.