androidx / androidx/media

Darken edge when using image overlay with transparency exported through Transformer lib

Open
#2,774 4 comments 1 reaction 1 assignee View on GitHub

@droid-girl is already working on this.

Since Jul 6, 2026.

bug editing
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

main & version 1.8.0

Devices that reproduce the issue
  • Pixel6
  • many other phones
Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Media3TransformerBlendingTest.zip
Please try this project. It includes all the asset and setup for reproducing the issue.

Expected result

The alpha blending will work normally and the dark edge is not shown around the sticker overlay.

Actual result

As you see from the following video, there is a dark edge around the sticker. I believe this is due to the blending setup for GLES.

https://github.com/user-attachments/assets/c1b20083-558e-4e8f-863a-c4afc64a7095

If I load the image in straight alpha format using following snippet, then the edge seems correct.

        val staticImage = context.assets.open("image1.png").use {
            val bitmapOption = BitmapFactory.Options().apply {
                inPremultiplied = false
            }
            BitmapFactory.decodeStream(it, null, bitmapOption)
        }!!

From

Image

to

Image

BTW, I also tried to load the image as an MediaItem, and the result is the same. The blending is wrong.

Media
Image

The video is streamed from internet. The url is in the project source code.

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.