Skip to content

Bleeding opaque pixels into fully transparent pixels #797

@johannesroth-coreproduction

Description

The attached .png has a horribly bright RGB value (index 0 of palette) on its fully transparent pixels.

Image

Rendering it filtered results in a bright outline, see also https://github.com/DragonMinded/libdragon/wiki/Mksprite#avoiding-outline-artifacts-with-bilinear-filtering

Suggestion for a new feature: implement a command line option for mksprite to auto-bleed edge pixels outwards, so that it looks good when filtered without the user having to fix the alpha channel manually.

Perhaps amount of iterations for bleeding algorithm can be manually set (but I think usally 2 is a good value?)

Attention: the algorithm used for bleeding could depend on the 2D art style, e.g. if outlines are used then the exact index color should bleed outwards, while on styles without an outline it might be preferable to mix 4-or-8 neighbour-pixel colors.

Need to also decide if extended colors are always part of the palette or if new values can be mixed for RGB textures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions