Skip to content

extract images #10

@milahu

Description

@milahu

use darkmode to find jpg images with white background

darkmode: reader settings -> page color: black
create 2 screenshots of every page: light + dark
text changes color, images dont change color
take difference of light and dark screenshots
difference is black -> text
difference is white -> image

bonus points for detecting QR codes, and converting them to sharp SVG images

example

magick compare light.png dark.png -compose src -highlight-color black -lowlight-color white diff.png

light.png

Image

dark.png

Image

diff.png

Image

todo: find large white boxes in diff.png and use them to extract images from light.png

image processing is much simpler in python
first attempt: align-pages.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions