Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

326
Visualizações
Add texture of img1 to img2 to get result img - Python / Javascript

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

Img1

Img2

Img3


about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Here is how to do that in Imagemagick. It can be done in Python/OpenCV, but I do not have the time now to implement it. It is pretty easy in Imagemagick using one of my bash shell scripts to do the spherize of the texture.

(I show how to do the spherical distortion in Python/OpenCV at How make eye and nose bigger or smaller in opencv and python in a previous post. And an example showing how to do the hard light composite in Python/OpenCV is in How to augment scanned document image with creases, folds and wrinkles?)

  • First, I have to trim the sphere image to its bounds and have it square dimensions.
  • Then I have to resize the texture image and crop it to the same dimensions as the trimmed sphere image.
  • Then I apply the spherize script to the cropped texture image
  • Finally I save the alpha channel from the sphere image and do a hardlight composite of the sphere image with the spherized texture image. And save the result

Sphere Image:

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda