Page 1 of 1

Mug mockup

Posted: 2018-04-26T01:51:20-07:00
by kamil
Hello. I write applications in Ruby, which I want to create design on mug.
At the beginning, I download a photo of design and change its scale to the size of the cup without handle(I think I should do it). Then I will supplement the background, changing the size of the image to 1234x1526.

Code: Select all

MiniMagick::Tool::Convert.new do |convert|
  convert << "C:/Users/Administrator.SERVER/Desktop/ruby/-B-.png"
  convert << "-resize"
  convert << "1234x1526"
  convert << "-gravity"
  convert << "center"
  convert << "-extent"
  convert << "1234x1526"
  convert << "output.jpg"
end
and receives something like that.
Image
And finally, with the help of these commands, i would do cylindrize on alien. But no idea how to setup that, What i should change too look good.
http://www.imagemagick.org/Usage/mappin ... rtion_maps -->>> Cylindrical Displacement

Code: Select all

convert ^
  output.jpg -background black -gravity south -splice 0x8 ^
  ( +clone -sparse-color barycentric "0,0 black 1234,0 white" ) ^
  ( +clone -function arcsin 0.5 ) ^
  ( -clone 1 -level 25%%,75%% ^
    -function polynomial -4,4,0 -gamma 2 ^
    +level 50%%,0 ) ^
  -delete 1 ^
  -virtual-pixel black  -compose displace -define compose:args=142x54 -composite ^
  outputMug.png
  
I would like to put the aliens on a cup.
Image
I'm currently using photoshop and smart objects for this process, but it can not be done on linux (the company uses amazon ec2)

Meaby that image from photshop will help to visualize that
Image


I will buy big beer for help :) Sorry for my english.

Re: Mug mockup

Posted: 2018-04-26T09:22:26-07:00
by fmw42
See my bash unix shell script, cylinderize and cylinderwarper, at my link below.

Re: Mug mockup

Posted: 2018-04-27T00:49:33-07:00
by kamil
OK I use cyliderize ./cyliderize -m vertical -p 20 w- 100 in.png out.png
But how can i in one command line make out.png 1237x1526 (mug size) and compose with mug background and set position for design?

OK i found how to do it :) thanks

Thanks.