GithubHelp home page GithubHelp logo

Comments (4)

adrhill avatar adrhill commented on June 18, 2024

Would you just use an IndirectArray before or after applying the dithering algorithm?

from ditherpunk.jl.

johnnychen94 avatar johnnychen94 commented on June 18, 2024

I think it's making the output of the dithering algorithm an IndirectArray, and let the consumers of dither decide whether they need a collect. For fixed color dither this should save a bunch of memory I believe.

from ditherpunk.jl.

adrhill avatar adrhill commented on June 18, 2024

Sounds good! If a regular array is passed to dither!, should it be turned into an IndirectArray too?

This is also a good excuse to add #35. ;)

from ditherpunk.jl.

johnnychen94 avatar johnnychen94 commented on June 18, 2024

If a regular array is passed to dither!, should it be turned into an IndirectArray too?

Oh for this you simply can't, because if you create a new array out for dither!(out, img), then it's a different memory.

function f!(out, src)
    out = zeros(4, 4)
    out .= src
    return out # this `out` is not the outside `out`
end

out = zeros(4, 4);
src = rand(4, 4);
f!(out, src)
out == src # false

But it's doable to out .= inner_indirect_array_out before returning.

from ditherpunk.jl.

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.