Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

301
Vistas
HTML5 Canvas - Certain images are blurry when drawn with context.drawImage()

Certain images are blurry when drawing them onto an HTML5 canvas.

The example below draws two images using context.drawImage(). One of the images is blurry whereas the other looks as expected.

blurry image

Javascript code to draw the image onto the canvas - jsfiddle

function drawImage(canvasId, imageId) {
  var canvas = document.getElementById(canvasId);
  var ctx = canvas.getContext("2d");
  var img = document.getElementById(imageId);

  canvas.width = img.width;
  canvas.height = img.height;

  ctx.drawImage(img, 0, 0, img.width, img.height);
}

// draw blurry example
drawImage('canvas1', 'img1');

// draw non blurry example
drawImage('canvas2', 'img2');

Any help would be appreciated. Thanks.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda