Multiply Image by 6 and export

Do you need consulting from ImageMagick experts and are willing to pay for their expertise? Or are you well versed in ImageMagick and offer paid consulting? If so, post here otherwise post elsewhere for free assistance.
Post Reply
berndh70
Posts: 4
Joined: 2019-07-26T05:58:46-07:00
Authentication code: 1152

Multiply Image by 6 and export

Post by berndh70 »

Hello Imagemagick professionals,

I need to convert images of winebottles. I have a jpg image of the bottles, all same height but different width (according to the bottlesize).

The image of the bottle has to be resized, multiplied by 6 (or 3) and pasted in a new image of a rectangular size (e.g. 1000 x 1000). So the original image contains one bottle, the resulting image contains 6 (or 3) similar bottles of the original.

I need a script, that converts every image in a specific folder with this procedure.

Can somebody provide help with that? Offers for that would be very appreciated. /* To the admins - I am willing to pay for it */

Thanks in advance and kind regards

Bernd
Last edited by berndh70 on 2019-07-26T09:14:45-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Multiply Image by 6 and export

Post by snibgo »

What version of IM, on what platform?

You need to resize, but to what size? The same size for all images, or is there some rule for the new size?

Perhaps sample input and output images would help.
snibgo's IM pages: im.snibgo.com
berndh70
Posts: 4
Joined: 2019-07-26T05:58:46-07:00
Authentication code: 1152

Re: Multiply Image by 6 and export

Post by berndh70 »

Hi snibgo,

thanks for the reply. I installed the program today via Homebrew on a Mac, so I guess it's the current version, but I am not familiar with the software at all. I am just a "normal" user with little command line knowledge.

The pictures all have the same height of 800px. The width is different depending on the bottle.

Example for 6 bottles:
Original file wine1:
Result file wine1:

Original file wine2:
Result file wine2:

Example for 3 bottles:
Result wine2:

A process should look something like this:

numberOfBottles=6
canvasSize=1000

1. open the original file
2. scale it to [canvasSize/numberOfBottles] width (=166px)
3. generate a canvas of [canvasSizexcanvasSize] (=1000x1000px)
4. paste [numberOfBottles] in one line on the canvas
5. save resulting picture under filename [numberOfBottles]+"x"+originalFilname.jpg in a designated folder

This process should apply to all pictures in a specific folder. A script for another number of bottles should do the same accordingly. I basically need this script for 3 and 6 bottles.

Hope I could clarify a little. Please don't hesitate to ask any questions or if everything is clear send me an offer. I would prefer to pay via Paypal.

Thanks in advance
Bernd
Last edited by berndh70 on 2019-07-26T23:00:00-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Multiply Image by 6 and export

Post by snibgo »

berndh70 wrote:... via Homebrew on a Mac
I'll leave this for Fred or anyone else.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply Image by 6 and export

Post by fmw42 »

What version of ImageMagick did you install?

On IM6 on command line type

Code: Select all

convert -version
On IM7 type

Code: Select all

magick -version
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply Image by 6 and export

Post by fmw42 »

How much space should be put between the bottles? Can you quantify that in percent of width of the image or pixels? Or should it just use whatever space you provide.

The simple command would be something like

Code: Select all

number=6
dups=$((number-1))
file="image.jpg"
convert "$file" -duplicate $dups +append -resize 1000x1000 -background white -gravity center -extent 1000x1000 "${output_directory}/${number}x${file}"
I have to go out for a while but I will work on this later today. I presume you want a shell script or do you need an AppleScript?
berndh70
Posts: 4
Joined: 2019-07-26T05:58:46-07:00
Authentication code: 1152

Re: Multiply Image by 6 and export

Post by berndh70 »

Version: ImageMagick 7.0.8-56 Q16 x86_64 2019-07-24 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype heic jng jp2 jpeg lcms ltdl lzma openexr png tiff webp xml zlib

And I think a shell script is fine. You just have to explain me the proper excecution ;-)

And thanks for helping!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply Image by 6 and export

Post by fmw42 »

Please send me private mail on this system with your actual email address so that I may contact you directly and send the script. No charge, since I think it is very simple.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply Image by 6 and export

Post by fmw42 »

Are all the input images JPG? If not, what other formats does the script have to process?
berndh70
Posts: 4
Joined: 2019-07-26T05:58:46-07:00
Authentication code: 1152

Re: Multiply Image by 6 and export

Post by berndh70 »

Sent you a message on the board.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply Image by 6 and export

Post by fmw42 »

I receive no new messages from you since this morning. Are you sure you sent it?
Post Reply