Skip to content

Incorrect trimming of single pixel line of another color #4528

@RblSb

Description

@RblSb
import sharp from "sharp";
import fs from "fs";

sharp(fs.readFileSync("image.png")).trim({
	threshold: 0,
	background: "#00000000",
	lineArt: false
}).toFile("trimmed.png");

image:
Image
trimmed result:
Image

But it trims correctly with lineArt: true. I want to ask if this is intended behavior, because lineArt description doesn't really explain much. Maybe it should trim only transparent pixels in both cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions