Open niravasher opened 4 years ago
I would like to work on it .
Go ahead @daemon1024
Hi, Can i also work on this ?
Sorry but someone has already claimed the issue.
Yeah, sure @HarshKhandeparkar Thank!
Thanks @niravasher. I have a few queries regarding this issue.
We will be compressing BMP/RAW files or JPEG/PNG files (Since they are already compressed version of the prior) too? ( Something like this https://medium.com/breaktheloop/jpeg-compression-algorithm-969af03773da maybe )
We need to implement the algorithm without any third party libraries or we can use libraries if needed.
1) Users of image sequencer will upload JPEG/PNG images for compression, so you should start with that I think. 2) You can use third party libraries if needed @daemon1024
From what I have researched for the last day, compression algorithms are based on bitmap images. So maybe we can convert the images to bitmap , compress them using algorithms like Huffman and then convert them back to BMP.
Conversion to BMP and the other way round can be done using OpenCV.Js .
I don't know if I am in the right direction or this a feasible idea so wanted to lay out what I have understood right now.
Also we can use something like https://tinypng.com/developers/reference/nodejs. I couldn't find anything that directly losslessly compresses jpeg. https://compressor.io/compress provides lossless compression but it seems to be patented.
@niravasher @HarshKhandeparkar
@publiclab/is-reviewers
Also we can use something like https://tinypng.com/developers/reference/nodejs. I couldn't find anything
Yes, I think this works. Also check these for further reference :- https://www.npmjs.com/package/tinify. This compresses both PNG and JPEG, although I am not sure if they are lossy or lossless. https://www.npmjs.com/package/compress-images @daemon1024
I looked into the module it uses algorithms like jpegoptim, mozjpeg, optipng which support lossless compression. So maybe we can implement it in a way such that users are given control if they want lossless or lossy and which algorithm they want to use. @niravasher
Initially build the module for lossless compression only, open a PR, then as per instructions from reviewers you could add options @daemon1024
Try to chose a library that supports both, lossless and lossy.
@daemon1024 are you still working on this?
@niravasher Yes, I am working on this. I have most of the stuff offline.
Should I make a PR with WIP? I haven't made significant progress in code implementation cause I spent most of the week in understanding how is image-sequencer working and traversing through the codebase. I will have a initial module ready by end of the week.
@daemon use this https://www.npmjs.com/package/compress-images . Setting quality to 100 will lead to lossless compression and setting it less than 100 will lead to lossy compression. Plus it provides an option to choose among a lot of compression algo's
@daemon1024
Hi @niravasher ,
I was starting with the initial implementation of the module. But I can't seem to understand how is the input coming and in which format i return the output. I saw other modules and it seemed that they were returning an object but I don't understand how would we return an object.
My initial commit : https://github.com/daemon1024/image-sequencer/commit/ccca8feef9d079d5e1fcf7e2c869b74fecef9cf3
I have commented on your commit, check it out @daemon1024
Thanks @niravasher , will work on it!
@niravasher made the changes you requested, Here's the commit https://github.com/daemon1024/image-sequencer/commit/7faad06f443892fe93ba948e3c13e9baad467dac
Should I make a PR with [WIP] tag to have a better discussion?
Why not @daemon1024 . Also ask reviewers for help
Please describe the problem (or idea)
What did you expect to see that you didn't?
A new module for compressing images without loss of any data (lossless compression)
various algorithms are present for the same purpose. Deflate - https://github.com/madler/zlib/blob/master/deflate.c Chain code algorithm - https://www.geeksforgeeks.org/chain-code-for-2d-line/
Thank you!
Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.
To learn how to write really great issues, which increases the chances they'll be resolved, see:
https://publiclab.org/wiki/developers#Contributing+for+non-coders