Skip to content

Commit ebd05c0

Browse files
author
fwmone
committed
Setting JPEG image quality to 0.90 instead of 0.98 to reduce image sizes; files too large might lead to BLOOMIN8 picture frame hiccups. Lower image quality should not be visible on the frame.
1 parent 9efc4c1 commit ebd05c0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eink-optimize",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Optimization for Spectra6 eInk picture frames",
55
"dependencies": {
66
"canvas": "^3.2.0",

server.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,13 @@ app.post("/optimize", upload.single("image"), async (req, res) => {
179179
// Convert the colors to the display's native colors
180180
replaceColors(ditheredCanvas, ditheredCanvasWithDeviceColors, palette);
181181

182-
buf = ditheredCanvasWithDeviceColors.toBuffer("image/" + format, { quality: 0.92 });
182+
buf = ditheredCanvasWithDeviceColors.toBuffer("image/" + format, { quality: 0.90 });
183183
} else {
184-
buf = inputCanvas.toBuffer("image/" + format, { quality: 0.98 });
184+
buf = inputCanvas.toBuffer("image/" + format, {
185+
quality: 0.90,
186+
progressive: false,
187+
chromaSubsampling: true
188+
});
185189
}
186190

187191
res.setHeader("Content-Type", "image/" + format);

0 commit comments

Comments
 (0)