Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!