Emre Özer
Emre Özer

Reputation: 23

THREE.ImageUtils.getDataURL

THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons

I'm getting an error like this and its appearing every seconds in my console. I'm using globe.gl with vuejs and its my background image. It was png but I changed to the jpg because of this error but I'm still getting same error. Here is part of my code;

import earthbg from "../textures/sky.jpg";

const world = Globe()(document.getElementById("globeViz")) .globeImageUrl(${earthmap}) .backgroundImageUrl(${earthbg}) ...

What's the reason of this? I googled it but no one else getting this I guess. This image is 349 KB, 4096 x 2048. Does anyone know these error?

Upvotes: 0

Views: 737

Answers (1)

2pha
2pha

Reputation: 10155

In the source of THREE.ImageUtils you can see why.

if ( canvas.width > 2048 || canvas.height > 2048 ) {

  console.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image );

  return canvas.toDataURL( 'image/jpeg', 0.6 );

} else {

  return canvas.toDataURL( 'image/png' );

}

Upvotes: 1

Related Questions