Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Ability #11

Open
anonrig opened this issue Feb 26, 2016 · 3 comments
Open

Download Ability #11

anonrig opened this issue Feb 26, 2016 · 3 comments
Labels

Comments

@anonrig
Copy link

anonrig commented Feb 26, 2016

Is it possible to download the filtered version of the image using cssco?

@laurenwaller
Copy link
Owner

Hi @anonrig, it's currently not possible, the only way you could do it is with a screenshot (which is a bit of a hack). But we will definitely consider implementing that :) Thanks for getting in touch!

@anonrig
Copy link
Author

anonrig commented Mar 1, 2016

I found a great fiddle about this.

https://jsfiddle.net/8ypxW/3/

@laurenwaller

@benydc
Copy link

benydc commented Mar 27, 2018

I find this best works with dom-to-image package, it copies all the css styles from parent div node. I use it like this and receive the dataURI for the filter image:

this.imageReference.onload = () => {
      var div = document.createElement("div");
      div.className = "cssco cssco--b5";
      div.appendChild(this.imageReference.cloneNode());
      domtoimage.toJpeg(div, { width: 900, height: 600, quality: 1.0 })
        .then((dataUrl) => {
          console.log(dataUrl);
        });

    };

    this.imageReference.src = "image.jpeg"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants