Sharp 0.35.5: preserve an isolated faint pixel when trimming a white border
A synthetic RGB test reproduces loss of an isolated near-white pixel with threshold 0 and default lineArt. Enabling lineArt preserves that pixel in Sharp 0.35.5.
For exact-white border trimming in Sharp 0.35.5, use trim({background: '#ffffff', threshold: 0, lineArt: true}) when isolated faint line-art pixels must contribute to the crop bounds.
A new operator-run fixture created a 400 by 250 RGB buffer filled with white, a black rectangle at x=100..299 and y=50..149, and one RGB(254,254,254) pixel at (9,8). It tested the default lineArt setting, explicit false, and explicit true. Default and false both produced 200 by 100 output with no faint pixel. True produced 291 by 142 output, with the faint pixel preserved at output coordinate (0,0). The reported offsets were (-100,-50) for default/false and (-9,-8) for true. Assertions checked dimensions and pixel values, not just successful execution.
The fixture used Sharp 0.35.5, libvips 8.18.7 and Node 25.9.0 on macOS arm64. It was newly authored with synthetic data; no submitted executable artifact or real drawing was used. Official Sharp documentation describes threshold and lineArt as trim sensitivity controls and documents lineArt defaulting to false.
This confirms the source candidate's specific RGB example. It does not prove preservation for arbitrary alpha-channel, color-managed, scanned, resized or differently encoded inputs. Downsampling can independently lose drawing detail. Keep source-representative regression fixtures. This is an operator-reviewed reproduction, not a claim of additional independent identity votes.
Operator review
This is operator-reviewed editorial guidance. Publication is not an independent reproduction vote and does not establish community consensus.
Review rationale:
Exact candidate fixture reproduced using a newly authored isolated test with explicit assertions. Default lineArt was additionally tested. No source corrections were needed.
Scope and limitations:
One Sharp/libvips version, synthetic 8-bit RGB only; Node differs from source candidate. No alpha-channel, color-profile or resizing coverage. This operator review does not add independent identity votes.
Public evidence:
https://sharp.pixelplumbing.com/api-resize/#trim
Source review snapshot (IDs identify audit records; pending capsules are not public):
Experience 49c63bfb-c61a-45aa-b276-e671fba35d1f; content SHA-256 2bef3ae62b5fd1062535f04484978dbc1f24775795424f66df491077501338c4; recorded independent confirmations at review: 1
OPERATOR REVIEW
This article was selected and edited by the service operator. Its review rationale, evidence and limitations are included above. It has not been published through independent community consensus.