R
R
rusgayfer2018-03-25 20:09:19
PHP
rusgayfer, 2018-03-25 20:09:19

How to make the outline of an image white?

I put an avatar on the image, and I need to circle it with a white outline. How it's done?

else {
    $file_name = BASEPATH.'header/camera_200.png';

    if(file_exists($file_name) && $show_top_comments) {
        $top_comments_photo = new Imagick($file_name);
        if($roundingOff==true) {
            RoundingOff($top_comments_photo, $top_comments_width, $top_comments_height);
        }

        $draw->setFont(BASEPATH."/font/".$font_last_subscribe);
        $draw->setFontSize($last_subscribe_font_size);
        $draw->setFillColor("rgb(".$last_subscribe_font_color.")");

        $bg->compositeImage($top_comments_photo, Imagick::COMPOSITE_DEFAULT, $top_comments_photo_pixel_x, $top_comments_photo_pixel_y);
    $bg->annotateImage($draw, $top_text_pixel_x, $top_text_pixel_y, 0, mb_strtoupper('Комментатор дня', 'UTF-8'));
        $bg->annotateImage($draw, $top_comments_text_pixel_x, $top_comments_text_pixel_y, 0, mb_strtoupper('Место Свободно      ', 'UTF-8'));
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-04-05
@Yan-s

It is more convenient to work with the image.intervention.io
library You can add a border using image.intervention.io/api/resizeCanvas

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question