jimp-dev/jimp

Grayscale images aren't saved as 8-bit PNGs or JPEGs

Open

#913 opened on 2020年7月17日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (13,218 stars) (785 forks)batch import
bughelp wanted

説明

Expected Behavior

When writing images to disk after calling greyscale() method should produce 8-bit PNGs and JPEGs.

Current Behavior

Even when greyscale() is called images are still 24 or 32 BPP. After some digging I've discovered that you can get 8-bit PNGs by leveraging the colorType() method. Unfortunately no such thing for JPEGs.

Steps to Reproduce

Jimp.read('image.png').then(image => {
  image.greyscale().write('image_greyscale.png');
});

Jimp.read('image.jpg').then(image => {
  image.greyscale().write('image_greyscale.jpg');
});

Context

  • Jimp Version: 0.14
  • Operating System: Windows 10
  • Node version: 12

コントリビューターガイド

Grayscale images aren't saved as 8-bit PNGs or JPEGs · jimp-dev/jimp#913 | Good First Issue