Page 1 of 1

Wood tiles overlay with multiply, offset & density

Posted: 2013-11-04T11:03:57-07:00
by christiaan
Hello,

I struggling with this issue. I have two files:
  • Source image (landscape) created with "convert" with -units PixelsPerInch at a density of 20
  • Wood vertical tile image @ 150 DPI
I need to overlay the source image with the wooden tiles next to each other in multiply mode, but I can't get it working. The tiles are way too big for the source image:

Code: Select all

composite \
-compose Multiply \
-tile wood.jpg \
source.jpg \ 
source.jpg
I need to scale down the tile to 20 DPI too, but I can't find a way of doing that.

Next to that problem I need to offset the tiles from the left and upper side.

How do I do this? I hope you guys can help me out here. Thanks in advance.

Below are the resources:

Re: Wood tiles overlay with multiply, offset & density

Posted: 2013-11-04T11:34:00-07:00
by snibgo
Don't worry about DPI. ImageMagick works with image sizes in pixels, not DPI.

Offsets are usually done with "-geometry". Can you provide your input images (put them in dropbox.com or somewhere, and paste the links here)? Ideally also a mockup of what you are trying to do.

Re: Wood tiles overlay with multiply, offset & density

Posted: 2013-11-04T14:22:05-07:00
by christiaan
I just posted the input files above in the original post. The wood image should be exactly on the white lines on source.jpg.
I think I can handle the DPI problem by myself right now, but I don't think "composite" is the right command for my use.

Re: Wood tiles overlay with multiply, offset & density

Posted: 2013-11-04T15:28:29-07:00
by fmw42
try this. you can adjust the size and offsets as needed. I tried to measure the inside of the pink border, but am not sure if it was perfectly accurate.

Code: Select all

convert source.jpg \( -size 2863x2122 tile:wood-px.jpg \) -geometry +13+16 -compose multiply -composite result.jpg

Re: Wood tiles overlay with multiply, offset & density

Posted: 2013-11-05T00:59:47-07:00
by christiaan
Thanks fmw42! That seems to do the trick. Is it also possible to get the width & height of the loaded image source.jpg, instead of manually entering pixel sizes?

Re: Wood tiles overlay with multiply, offset & density

Posted: 2013-11-05T10:59:37-07:00
by fmw42

Code: Select all

xoff=13
yoff=16
xsize=`convert source.jpg -format "%[fx:w-2*$xoff]" info:`
ysize=`convert source.jpg -format "%[fx:h-2*$yoff]" info:`
convert source.jpg \( -size ${xsize}x${ysize} tile:wood-px.jpg \) -geometry +${xoff}+${yoff} -compose multiply -composite result.jpg