question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Black border on right and bottom of resized image

See original GitHub issue

I’ve experience an issue where the resized image has a black border on the right and bottom of the image. This issue appears to be isolated to certain images and changing the resize kernel and / or sharpening the image do not remove the artifacts.

Sharp: 0.20.1

Source: source

Result: output

Code:

sharp(source)
  .resize(200)
  .withoutEnlargement()
  .min()
  .jpeg()
  .toBuffer();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jcupittcommented, Apr 10, 2018

I agree, I’m very uncomfortable pushing a big change out like this, but it’s a serious problem and I cant think of a workaround. I’ll make 8.6.4 in a few days with this thing in.

0reactions
lovellcommented, Oct 4, 2018

sharp v0.21.0 is now available with a prebuilt libvips v8.7.0 that contains the upstream fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

generated image has right and bottom black border on ...
The border is only generated when the image is a transparent one (in my case: 'outline', 'invert', 'black' image type. Look at the...
Read more >
How do I resize my screen it has a 2 inch black border on both ...
Change Screen Resolution. 1. Right click on your Desktop. 2. Click Screen Resolution. 3. Select the resolution you want. 4. Click apply.
Read more >
Remove Black Borders Around Your PC Monitor Screen
Remove Black Borders Around Your PC Monitor Screen | Resize Desktop To Fit | NVIDIA Control PanelIn this Windows 10 tutorial I will...
Read more >
Resizing jpg images results in black borders
A black background is visible when a jpg image is resized. JPG images cannot have a transparent background. By default, it is set...
Read more >
How to Add a Black Border to Photos using Affinity Photo
To add our border to the photo we need to resize the canvas so that it extends ... Now click and drag with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found