1

Good day,

We are trying to generate these lines in an image in php.

Image with random lines

enter image description here

But we haven't close enough like this one.

Is there anything you can suggest to generate this kind of image via PHP?

Thank you.

PS. We used PHP GD library.

This is my code.

$image = imagecreatetruecolor(200, 50);
    $background_color = imagecolorallocate($image, 255, 255, 255);  
    imagefilledrectangle($image,0,0,200,50,$background_color);
    $line_color = imagecolorallocate($image, 211,211,211); 
    for($i=0;$i<40;$i++) {
        imageline($image,0,rand()%50,200,rand()%50,$line_color);
    }

    imagepng($image, "image.png");

0 Answers0