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

mask file #1

Open
zvezdochiot opened this issue Jul 3, 2023 · 0 comments
Open

mask file #1

zvezdochiot opened this issue Jul 3, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zvezdochiot
Copy link
Member

zvezdochiot commented Jul 3, 2023

Hi @trufanov-nok and @plzombie .

Собственно, jpeg кодер. Возникла задача дополнительной фильтрации по маске. Саму задачу изложил здесь: wfus/jpeg-compressor@839ca29#commitcomment-120504770 . Продублирую:


This encoder is specific and ideal for comic book material. It is more suitable for such material than mozjpeg (IMHO).

For certain purposes (https://github.com/ImageProcessing-ElectronicPublications/imthreshold/blob/master/bash/pdf/mfbpdf-jbig2jpge.sh), I would like to have an additional optional quantizer in this encoder, set by the mask file:

jpge [options] <source_file> <dest_file> <quality_factor> [mask_file]

Where for each 8x8 block mask_file, the average brightness value is calculated: qmask=sum(area8x8)/count(area8x8). And with the help of these values, additional filtering is performed:

/* DCT = qmask_back(qmask_forward(DCT)) */
DCT[blokid][i][j] = (int) (DCT[blockid][i][j] * (qmask[blockid] + 1) / 256); // forward
DCT[blokid][i][j] = (int) (DCT[blockid][i][j] * 256 / (qmask[blockid] + 1)); // back

Сам явно не потяну. Или потяну, но не сейчас и криво.

Буду рад любой помощи. Не буду ни капли не против приглашения людей "со стороны".

См. также ImageProcessing-ElectronicPublications/jpegquant@287610c

@zvezdochiot zvezdochiot self-assigned this Jul 3, 2023
@zvezdochiot zvezdochiot added enhancement New feature or request help wanted Extra attention is needed labels Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant