What's new

Closed The right way of processing every pixel in an image

Status
Not open for further replies.
D

Deleted member 1207647

Guest
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();
}
?>
 

Attachments

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.

Similar threads

Back
Top