Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init('https://i2.wp.com/www.fatosmorina.com/wp-content/uploads/2018/11/hello-world.png?ssl=1');
- $fp = fopen('placa.png', 'wb');
- curl_setopt($ch, CURLOPT_FILE, $fp);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_exec($ch);
- curl_close($ch);
- fclose($fp);
- $im = imagecreatefrompng('placa.png');
- if($im && imagefilter($im, IMG_FILTER_GRAYSCALE))
- {
- echo 'Image converted to grayscale.';
- imagepng($im, 'placa_convertida.png');
- }
- else
- {
- echo 'Conversion to grayscale failed.';
- }
- imagedestroy($im);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement