Giter VIP home page Giter VIP logo

Comments (3)

mdraw avatar mdraw commented on August 18, 2024 1

To save the resulting image it has to be completely re-encoded, so both size changes and a slight drop in image quality can be expected.

The relevant code line for saving anonymization results to new images is here:

imageio.imsave(opath, frame)

imsave() is an alias to imwrite, which is documented at https://imageio.readthedocs.io/en/stable/userapi.html#imageio.imwrite.
Here you see that you can pass image format-specific options through the **kwargs, e.g. for .jpg see here: https://imageio.readthedocs.io/en/stable/format_jpeg-pil.html#parameters-for-saving

For decreasing the output file sizes, I would try lowering the quality setting to something lower than 75.

Can you change the line referenced above to something like

imageio.imwrite(opath, frame, optimize=True, quality=50)

and report if it works?

We can also make this configurable through a command line flag similar to the --ffmpeg-config option, which already exists to control video output codec options.

from deface.

Tralapo avatar Tralapo commented on August 18, 2024

Sorry, I see I forgot to reply.
For now I decided not to go ahead with this package. Although it would be great to make it more easily configurable, as the file size difference is quite big.

from deface.

frankenstein91 avatar frankenstein91 commented on August 18, 2024

@mdraw maybe a option to run the images through https://github.com/tjko/jpegoptim or http://optipng.sourceforge.net/ would be great.

from deface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.