D
D
Dmitry Bezruk2017-11-04 16:06:22
css
Dmitry Bezruk, 2017-11-04 16:06:22

Unique image generator?

Good day everyone!
Please tell me if there are such programs / services in nature for batch overlaying images on top of each other according to the principle https://ppc-help.ru/generator_phrases
I.e. we are preparing source images of the same size, for example 900x900px - 10 pictures of the main background, 10 png images with text with a transparent background that need to be superimposed on the main background and another 10 translucent patterns that we superimpose on top of everything. Thus, we immediately get 1000 unique options. It would be possible to add a couple more variables, then there will be more possible options.
Is there something with similar functionality?
Or maybe someone can help with the development - I would like to have 3-5 fields where folders with prepared images would be loaded and the generate button - at the output we get a folder with ready-made multiplied options.
I would be very grateful for your feedback!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
Lord_Dantes, 2019-08-10
@Lord_Dantes

Make the menu absolute when scrolling by at least 1px, and leave it as a regular block at the beginning of the screen.

C
Cheizer, 2019-08-10
@Cheizer

on the scroll event, add a class to the menu, and this class has the style position:fixed;

$(window).on('scroll', function () {
        var scroll = $(window).scrollTop();
        if (scroll < 105) {
            $(".menu").removeClass("sticky");
        } else {
            $(".menu").addClass("sticky");
        }
    });

A
Alexander Aksentiev, 2017-11-04
@Sanasol

https://freelansim.ru
https://github.com/stil/gd-text
https://github.com/Gregwar/Image

J
John Doe, 2017-11-05
@rabbit418

Everything is very simple. There is also GD. All that remains for us is to create 4 folders.
/backgrounds - drop backgrounds here
/filters - filters here
/texts - pictures with texts here
/results - ready-made pictures will be here
And run the script that I wrote below.

<?php
$backgrounds = array_diff(scandir('./backgrounds/'), array('.','..','.DS_Store'));
$texts = array_diff(scandir('./texts/'), array('.','..','.DS_Store'));
$filters = array_diff(scandir('./filters/'), array('.','..','.DS_Store'));

function nameGenerator($length) {
    return substr(str_shuffle("_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}

// 
foreach ($backgrounds as $background) {
    // 
    foreach ($texts as $text) {
        // 
        foreach ($filters as $filter) {
            // 
            $layer1 = imagecreatefrompng("./backgrounds/{$background}");
            $layer2 = imagecreatefrompng("./texts/{$text}");
            $layer3 = imagecreatefrompng("./filters/{$filter}");

            // 
            imagealphablending($layer1, true);
            imagesavealpha($layer1, true);

            // 
            imagecopy($layer1, $layer2, 0, 0, 0, 0, 900, 900);
            imagecopy($layer1, $layer3, 0, 0, 0, 0, 900, 900);

            // 
            imagejpeg($layer1, "./results/".nameGenerator(10).".jpg");

            // 
            imagedestroy($layer1);
            imagedestroy($layer2);
            imagedestroy($layer3);
        }
    }
}
?>

T
ThunderCat, 2017-11-04
@ThunderCat

gd, imagemagick, yes, even on canvas with js you can find solutions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question