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

Chrome 12 breaks toDataURL() #264

felixturner opened this Issue Jun 14, 2011 · 5 comments


None yet
4 participants

felixturner commented Jun 14, 2011; works in Chrome 11, not in Chrome 12.

No error thrown. Produces a transparent PNG of the correct dimensions. Confirmed issue exists for canvas and WebGL renderers on OS X and Win 7. Not sure if this is an issue with three.js or with Chrome, so posting here first.

Example URL showing issue:

  1. Click 'sample image' at top left
  2. Click 'save image' button below.
  3. Get empty PNG.

This comment has been minimized.


alteredq commented Jun 14, 2011

Seems like Chrome issue:

(the example there doesn't use three.js)

For me it didn't work already since quite some time, don't remember when, it may have been when canary switched to 12.


This comment has been minimized.


alteredq commented Jun 14, 2011

Hmmm, I just managed to get my example working simply by rendering one frame immediately before calling toDataURL, in the same callback.

Try something like this:

function saveImage() {

This comment has been minimized.


mrdoob commented Jun 14, 2011

You can also try something along these lines:

var new_window = 'about:blank' );
var image = new_window.document.createElement( 'img' );
image.src = _renderer.domElement.toDataURL();
new_window.document.body.appendChild( image );

This comment has been minimized.


felixturner commented Jun 15, 2011

both of those solutions work in my case. Thanks guys!


This comment has been minimized.

AntonioCoelho commented Mar 22, 2015

Hi do you know, how can i save with 300dpi, for print?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment