🔒 Closed The right way of processing every pixel in an image

Status
Not open for further replies.
D

Deleted member 1207647

Hello po may code po ako dito medyo simple lang na nag prorocess ng BAWAT pixel sa isang image, I am using a 500x500 image to practice.

Ang gusto ko po sana mangyari ay marecreate ang image through HTML, pero ang nangyayari is nagiging straight line siya.

640609


Here's my code po...

PHP:
$imagick = new Imagick("base.png");
$iterator = $imagick->getPixelIterator();
foreach($iterator as $row => $pixels) {
    foreach ($pixels as $column => $pixel) {
     echo '<div style="background-color: '.trim($pixel->getColorAsString(), "s").';min-width:10px;min-height:10px;margin:0 0 0 0;max-height: 1px; max-width:1px"></div>';
    }
    $iterator->syncIterator();
}
?>
 
tinry ko gawin yung original photo talaga, yung nandiyan sa screenshot ko is pixelated for privacy reasons

2073600 pixels 300MB hahaha not bad... atleast 7 minutes nagload mabilis na ba yun
 
Status
Not open for further replies.

About this Thread

  • 10
    Replies
  • 738
    Views
  • 2
    Participants
Last reply from:
Unknown user

Trending Topics

Online now

Members online
346
Guests online
574
Total visitors
920

Forum statistics

Threads
2,274,604
Posts
28,957,156
Members
1,234,344
Latest member
Ivokoiiii01
Back
Top