Thanks to visit codestin.com
Credit goes to github.com

Skip to content

composite produces ugly results in some cases #1301

Closed
@jcupitt

Description

@jcupitt

Consider:

$ more circle.svg 
<svg viewBox="0 0 100 100"><circle cx="50" cy="50" r="30" fill="#000" /></svg>
$ more square.svg 
<svg viewBox="0 0 100 100"><rect width="100" height="100" fill="#222" /></svg>

Then:

$ vips composite2 square.svg circle.svg x.png dest-in
$ vips extract_band x.png y.png 0 --n 3

Makes:

y

The sparkles disappear if you flatten the image rather than simply dropping the alpha, but they look untidy.

In dest-in we are swapping the alpha on a premultiplied image. Instead, we need to unpremultiply, swap, and re-premultiply. Some other blend modes need a similar change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions