Home > OS >  Add texture of img1 to img2 to get result img - Python / Javascript
Add texture of img1 to img2 to get result img - Python / Javascript

Time:03-09

I am trying to add texture and pattern of img1 to img2 to get result something like the result image img3 - Img2 is has transparent background and result Img3 must also have transparent background

enter image description here

Texture Image:

enter image description here

convert sphere.png -trim  repage sphere_trim.png

convert texture.jpg -resize 1375x1375^ -gravity center -crop 1375x1375 0 0  repage texture_resize_crop.jpg

spherize -a 1 -b white texture_resize_crop.jpg texture_resize_crop_spherize_a1.jpg

convert texture_resize_crop_spherize_a1.jpg \
sphere_trim.png \
\(  clone -alpha extract  write mpr:alpha  delete \) -alpha off \
\(  clone \) \
-compose hardlight -composite \
mpr:alpha -alpha off -compose over -compose copy_opacity -composite \
sphere_texture.png

Trimmed Sphere Image:

enter image description here

Resized and Cropped Texture Image:

enter image description here

Spherized Texture Image:

enter image description here

Result From Hardlight Composite:

enter image description here

  • Related