html2canvas icon indicating copy to clipboard operation
html2canvas copied to clipboard

Not working for webkit-filter

Open Prashu33 opened this issue 10 years ago • 40 comments

I'm using webkit brightness effect on canvas but while converting that canvas into new canvas these effects are not applied..

-webkit-filter: brightness(1.3); -moz-filter: brightness(1.3);

Prashu33 avatar Dec 26 '14 06:12 Prashu33

css filter's haven't been implemented

niklasvh avatar Dec 26 '14 14:12 niklasvh

I am also waiting for filters to be implemented, @niklasvh any idea if we could do it by ourselves? Regards

moxet avatar Mar 05 '15 05:03 moxet

+1. I'm waiting too

animista01 avatar Jul 14 '15 15:07 animista01

What about this new feature?

danielfigueroa avatar Aug 03 '15 03:08 danielfigueroa

+1. I'm waiting too

jonasmiddendorf avatar Jun 13 '16 22:06 jonasmiddendorf

Me too, expecting -webkit-filter:blur() work, thank you.

arsen2010 avatar Jun 14 '16 02:06 arsen2010

+1. waiting too

zhiyan avatar Jan 03 '17 11:01 zhiyan

+1

ghost avatar Jan 31 '17 21:01 ghost

+1

benlei avatar Feb 14 '17 08:02 benlei

+1

kriosguerra3 avatar Mar 06 '17 21:03 kriosguerra3

+1

LanderBeeuwsaert avatar Aug 14 '17 20:08 LanderBeeuwsaert

+1

fernandofc avatar Aug 24 '17 20:08 fernandofc

+1

alexkostenko avatar Sep 01 '17 13:09 alexkostenko

I wrote a tiny library that could screenshot the image along with the css filter properties, hope it helps https://github.com/cyan33/image-screenshot

cyan33 avatar Feb 09 '18 18:02 cyan33

I wrote a tiny library that could screenshot the image along with the css filter properties, hope it helps https://github.com/cyan33/image-screenshot

great

shudery avatar Dec 17 '18 12:12 shudery

I added basic filter support into html to canvas. https://github.com/niklasvh/html2canvas/pull/1763

Prindl avatar Feb 25 '19 01:02 Prindl

+1 @Prindl @niklasvh any updates on the pull request (#1763) that was submitted for handling CSS filters?

sho-87 avatar Nov 05 '19 13:11 sho-87

Updates?

byeze avatar Mar 24 '20 03:03 byeze

fix #2300

ysk2014 avatar Sep 01 '20 04:09 ysk2014

Lately I've been converting Flash based web apps to HTML5/CSS and JavaScript. I've been using html2canvas to capture the HTML elements and converting them into images. Only problem I've been having is that it does not support filters and webkitTextStroke . I've been trying @ysk2014 #2300 fix, but it doesn't produce good results with webkitTextStroke and filters doesn't seem to be supported at all. I've tested with the Blur filter and the Shadow filter.

istoan avatar Oct 19 '20 12:10 istoan

@istoan Can you provide some examples of not working? All the examples I wrote are in the tests folder:

  • tests/reftests/images/filter.html
  • tests/reftests/text/stroke.html
  • tests/reftests/text/font-color-gradient.html

ysk2014 avatar Oct 20 '20 02:10 ysk2014

@ysk2014 I may not have the right html2canvas version. Where can I find a compiled version with support for filters and stroke? Is there a way to download a html2canvas.js file?

istoan avatar Oct 20 '20 10:10 istoan

@istoan you can git clone [email protected]:ysk2014/html2canvas.git and run npm start

ysk2014 avatar Oct 20 '20 10:10 ysk2014

I managed to clone that after installing the Git Desktop app. I then opened the folder with VS Code and opened Terminal inside VS Code. Then I typed: npm start and I got the following error:

[email protected] start C:\Users\Paul\Documents\GitHub\html2canvas node tests/server

internal/modules/cjs/loader.js:584 throw err; ^

Error: Cannot find module 'express' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (C:\Users\Paul\Documents\GitHub\html2canvas\tests\server.js:1:79) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node tests/server npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Paul\AppData\Roaming\npm-cache_logs\2020-10-20T11_19_02_101Z-debug.log

What am I doing wrong? And, is there an easier way to get a compiled version? Can you upload one to your repository?

istoan avatar Oct 20 '20 11:10 istoan

@ysk2014 I'm new to this. I believe I first had to install all the dependencies needed. I did npm install and got all of them. I then typed npm start and I got:

[email protected] start C:\Users\Paul\Documents\GitHub\html2canvas node tests/server

Server running on port 8080 CORS server running on port 8081

But it seems I can't find a html2canvas.js file. Not sure how to actually compile one so I can use it in my project.

istoan avatar Oct 20 '20 11:10 istoan

@istoan Run npm run build. A dist folder will be generated with the JS file you want

ysk2014 avatar Oct 20 '20 12:10 ysk2014

@ysk2014 I managed to compile the file and the results seem to be the same as with the other html2canvas.js file downloaded from https://github.com/niklasvh/html2canvas/suites/1187063696/artifacts/17429870

This is how it looks inside my HTML page: Screenshot of HTML Elements

This is the results produced with the new html2canvas.js code: Capture with html2canvas

Am I missing something? Are there some special arguments I need to add? Right now I use:

allowTaint: true,
scale: 2,
logging: false,
useCORS: true

istoan avatar Oct 20 '20 15:10 istoan

@istoan Can you provide the code? It's easy for me to find problems.

ysk2014 avatar Oct 21 '20 02:10 ysk2014

@ysk2014 An example can be found here: https://istoan.com/work/html2canvas-filters-test/

And the files for that example are attached html2canvas-filters-test.zip

istoan avatar Oct 21 '20 09:10 istoan

@istoan Sorry. Filter only supports img at present

ysk2014 avatar Oct 21 '20 10:10 ysk2014