Flip Image

NOTE: This only works in DO11.1 Beta 1 and higher!

DOpus added a FLIP argument to the Image CONVERT command. Thanks for this gentlemen!

Here are two different three-button setups incorporating both vertical and horizontal flip options:

The first simply overwrites the existing image file in the same location:

<?xml version="1.0"?> <button backcol="none" display="icon" textcol="none" type="three_button"> <label>Flip (overwrite)</label> <icon1>#DOpusBasic:imageconversion</icon1> <button backcol="none" display="icon" textcol="none"> <label>Flip Vertical (overwrite)</label> <tip>Flip image vertically, overwriting existing image</tip> <icon1>#DOpusBasic:imageconversion</icon1> <function type="normal"> <instruction>Image CONVERT FLIP=v HERE REPLACE</instruction> <instruction>@nodeselect</instruction> </function> </button> <button backcol="none" display="icon" textcol="none"> <label>Flip Horizontal (overwrite)</label> <tip>Flip image horizontally, overwriting existing image</tip> <icon1>#DOpusBasic:imageconversion</icon1> <function type="normal"> <instruction>Image CONVERT FLIP=h HERE REPLACE</instruction> <instruction>@nodeselect</instruction> </function> </button> </button>

The second saves the file in the same location with a new name (oldname_Flip_H or oldname_Flip_V):

<?xml version="1.0"?> <button backcol="none" display="icon" textcol="none" type="three_button"> <label>Flip</label> <icon1>#DOpusBasic:imageconversion</icon1> <button backcol="none" display="icon" textcol="none"> <label>Flip Vertical</label> <tip>Flip image vertically, saving as new image</tip> <icon1>#DOpusBasic:imageconversion</icon1> <function type="normal"> <instruction>Image CONVERT FLIP=v HERE ADDSUFFIX=_Flip_V</instruction> <instruction>@nodeselect</instruction> </function> </button> <button backcol="none" display="icon" textcol="none"> <label>Flip Horizontal</label> <tip>Flip image horizontally, saving as new image</tip> <icon1>#DOpusBasic:imageconversion</icon1> <function type="normal"> <instruction>Image CONVERT FLIP=h HERE ADDSUFFIX=_Flip_H</instruction> <instruction>@nodeselect</instruction> </function> </button> </button>

Both sit just fine on the Images toolbar next to the Rotate buttons!

As a third option, you can also use ImageMagick, a free image manipulation program with a robust toolset and command line interface.

This is what I used before Opus added the FLIP option. ImageMagick can do lots of other things so you may find it useful, even if it is not needed for flipping. No real reason to use an external tool for something built-in, but it does other things that are not built-in as well.

Here's a button setup to flip selected images horizontally or vertically:

<?xml version="1.0"?> <button backcol="none" display="icon" separate="yes" textcol="none" type="three_button"> <label>IM Flip</label> <icon1>#imageconversion</icon1> <button backcol="none" display="both" textcol="none"> <label>Flip Vertically</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>@disablenosel</instruction> <instruction>&quot;C:\Program Files\ImageMagick-6.8.8-Q16\convert.exe&quot; {filepath} -flip +repage &quot;{sourcepath}{file|noext} - vflip{file|ext}&quot;</instruction> </function> </button> <button backcol="none" display="both" textcol="none"> <label>Flip Horizontally</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>@disablenosel</instruction> <instruction>&quot;C:\Program Files\ImageMagick-6.8.8-Q16\convert.exe&quot; {filepath} -flop +repage &quot;{sourcepath}{file|noext} - hflip{file|ext}&quot;</instruction> </function> </button> </button>

If you use the ImageMagick version, be sure to edit the path to convert.exe as appropriate.