jimp-dev/jimp

luma709 greyscale

Open

#755 geöffnet am 26. Juni 2019

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (785 Forks)batch import
enhancementhelp wantedplugin-candidate

Repository-Metriken

Stars
 (13.218 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Is your feature request related to a problem? Please describe. For a project I'm working on, I need to get the greyscale algorithm to use the LUMA709 colour intensities.

Describe the solution you'd like

Essentially this should do it:

parseInt(
          0.299 * this.bitmap.data[idx] +
          0.587 * this.bitmap.data[idx + 1] +
          0.114 * this.bitmap.data[idx + 2],
        10
      )

Describe alternatives you've considered

I started to make the change, but realised that adding a new arg for the algorithm type will be a breaking change (function greyscale(algorithm, cb) {). Firstly, I was wondering if this feature is something you'd consider adding? And if so, is there is a preference for how it's implemented (i.e. a brand new colour method function greyscale709(cb) or something), or if adding an extra arg is the way forward.

Additional context

Awesome library btw! <3

Contributor Guide