Mug mockup

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kamil
Posts: 9
Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152

Mug mockup

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mug mockup

Post by fmw42 »

See my bash unix shell script, cylinderize and cylinderwarper, at my link below.
kamil
Posts: 9
Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152

Re: Mug mockup

Post 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.
Post Reply