lovell / lovell/sharp

Multiply alpha channel (was: Imagemagick's dissolve option)

Open
#618 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
JavaScript
Stars
32.7k
Forks
1.4k
Avg merge
1d 14h
Merged PRs (30d)
5

Description

Hi @lovell,
Does sharp support the option to dissolve a transparent image?
I was looking for something similar to imagemagick's dissolve option.
I took a look at the docs but could not find anything.
What i wanna achieve is to overlay a watermark, which works well but i would also like to dissolve it by ~35%.

```
return sharp(watermark)
.resize(width)
.toBuffer()
.then((outputBuffer) => {
return stream.overlayWith(outputBuffer);
});
```
> `stream` is the streamed base image and `watermark` is the watermark png file which i would like to dissolve.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stream.overlayWith(outputBuffer) call and the sharp overlay API; the issue names no source file or test. Determine how watermark opacity should be exposed and verified so that the overlay is applied at approximately 35% strength.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.