Code Monkey home page Code Monkey logo

Comments (8)

sksamuel avatar sksamuel commented on September 2, 2024

I will see what I can do to speed it up. Could you do me a favour and contribute an app inside src/test/scala that when run, prints out benchmarking of compression levels 0 to 9 ?

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

I see its not available on maven central, I'll just knock something up myself.

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

I reckon its because we use PNG optimization. Going to add an option to disable it and may disable by default.

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

For the bird image in src/test/resources (2000x1300),

Optimized (current default)
Compression level 0 took 1650ms
Compression level 1 took 2438ms
Compression level 2 took 2606ms
Compression level 3 took 3035ms
Compression level 4 took 3882ms
Compression level 5 took 4636ms
Compression level 6 took 6066ms
Compression level 7 took 7087ms
Compression level 8 took 9761ms
Compression level 9 took 12272ms

Unoptimized
Compression level 0 took 735ms
Compression level 1 took 706ms
Compression level 2 took 699ms
Compression level 3 took 690ms
Compression level 4 took 693ms
Compression level 5 took 690ms
Compression level 6 took 690ms
Compression level 7 took 691ms
Compression level 8 took 690ms
Compression level 9 took 686ms

from scrimage.

sebnozzi avatar sebnozzi commented on September 2, 2024

Hi, I see you did some benchmarks yourself... I don't quite get the optimized/unoptimized. I thought that was about compression. Sorry, kind of a newbie with this stuff.

The option of disabling by default seems good. Unsuspecting users would wonder why it's so slow otherwise.

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

The PNGTastic library that we use applies more optimizations that just the
normal compression levels in Java's Image Writer.
Problem is the PNGTastic library only works on PNG files and not byte
arrays. So I have to write it out as a PNG first, before then optimizing
it. Not sure what the better solution is, because I the extra flag is bit
crap I agree.

On 7 January 2014 21:23, Sebastian Nozzi [email protected] wrote:

Hi, I see you did some benchmarks yourself... I don't quite get the
optimized/unoptimized. I thought that was about compression. Sorry,
kind of a newbie with this stuff.


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-31780719
.

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

I've updated the PNG support to use a newer library.
This gives me these results on your image:

Compression level 0 took 88ms
Compression level 1 took 69ms
Compression level 2 took 74ms
Compression level 3 took 91ms
Compression level 4 took 117ms
Compression level 5 took 159ms
Compression level 6 took 264ms
Compression level 7 took 345ms
Compression level 8 took 623ms
Compression level 9 took 905ms

The new implementation is here:
https://github.com/sksamuel/scrimage/blob/master/core/src/main/scala/com/sksamuel/scrimage/io/PngWriter.scala

Do you want to test it from master and if it tests out ok I'll do a release of 1.3.14 with this included?

from scrimage.

sksamuel avatar sksamuel commented on September 2, 2024

I've released 1.3.14 anyway as I want to start on 1.4. Will be on maven central soon. Can you let me know your findings.

from scrimage.

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.