Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image size increases on quality reduction #1105

Open
Rounak-stha opened this issue Nov 2, 2022 · 0 comments
Open

Image size increases on quality reduction #1105

Rounak-stha opened this issue Nov 2, 2022 · 0 comments
Labels
bug there is a bug in the way jimp behaves file size issue help wanted

Comments

@Rounak-stha
Copy link

Using jimp's quality method does not give a expected linear result. After passing the quality percentage above the range of 60-65, the image quality increases.

const buffer = * JPEG image buffer *
console.log('Before Compression Size is ', Buffer.byteLength(buffer))
const data = await jimp.read(buffer).then(image => image.quality(65))
buffer = await new Promise((resolve, reject) => {
    data.getBuffer((jimp.MIME_JPEG), (err, buff) => {
        if (err) reject(err)
        console.log('After compression Size is ', Buffer.byteLength(buff))
    })
})

Results in:

Before Compression Size is: 429 
After Compression, Size is 744
@hipstersmoothie hipstersmoothie added help wanted bug there is a bug in the way jimp behaves file size issue labels Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug there is a bug in the way jimp behaves file size issue help wanted
Projects
None yet
Development

No branches or pull requests

2 participants