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

201
Views
Despixelizar una imagen

Estoy buscando una forma de despixelizar una imagen que pixelé con este código. Quiero saber si puedo cambiar el valor de la variable de tamaño de muestra con un detector de eventos o algo así. Gracias por leer esto y espero que alguien me ayude!

 let c = document.createElement("canvas") let img1 = new Image() img1.onload = function() { document.getElementById("img1").remove() w = img1.width h = img1.height c.width = w c.height = h ctx = c.getContext("2d") ctx.drawImage(img1, 0, 0,) let pixelarr = ctx.getImageData(0,0,w,h).data let samplesize = 10 for(let y=0;y<h;y+=samplesize) for(let x=0;x<w;x+=samplesize) { let p = (x+(y*w))*4 ctx.fillStyle = "rgba(" + pixelarr[p] + "," + pixelarr[p+1] + "," + pixelarr[p+2] + "," + pixelarr[p+3] + ")" ctx.fillRect(x,y,samplesize, samplesize) } let img2 = new Image() img2.src = c.toDataURL("img/jpeg") img2.width = 600 document.body.appendChild(img2) } img1.src = document.getElementById("img1").src
about 4 years ago · Santiago Gelvez
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!