Coder Social home page Coder Social logo

Saving the canvas as an image about filtrr HOT 5 CLOSED

alexmic avatar alexmic commented on September 23, 2024
Saving the canvas as an image

from filtrr.

Comments (5)

alexmic avatar alexmic commented on September 23, 2024

Hey,

Yes you can do that! The filtr object gives you access to the canvas element through the canvas() method. You can then do this (on click for example): window.open(filtr.canvas().toDataURL(), "w");

This will popup a new window with the image in it and you can then right click save-as. You can also insert an img tag into your document:
var newImg = document.createElement("img");
newImg.src = filtr.canvas().toDataURL();
document.body.appendChild(newImg);

}

from filtrr.

parth16 avatar parth16 commented on September 23, 2024

Thanks for the reply. This worked for me. I am trying to post the newly created image to Facebook using the Graph API. However, it's tricky as there's no file name or file path. Have you tried it out?

Thanks!

from filtrr.

alexmic avatar alexmic commented on September 23, 2024

If you put the output of toDataURL() as the src of an tag it will show the image.

from filtrr.

parth16 avatar parth16 commented on September 23, 2024

I found an issue where if you specify a image URL in the bigpic src attribute, then filtrr algo just hangs.

For the same photo, saved locally on my filesystem, the algorithm does work.

Have you tried this yourself?

from filtrr.

alexmic avatar alexmic commented on September 23, 2024

I tried it, it doesn't work because of a JavaScript security exception. More here: http://stackoverflow.com/questions/2704929/uncaught-error-security-err-dom-exception-18.

from filtrr.

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.