MPO format (3D)

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
matamouros

MPO format (3D)

Post by matamouros »

Greetings,

Anyone out there using MPO for 3D images? I need a command line *nix tool to process this (at least to transcode it to some kind of workable format), but I'm not finding anything... Anyone has the same problem? Any plans for ImageMagick to support this? This is the spec, BTW: http://www.cipa.jp/english/hyoujunka/ki ... -007_E.pdf

Thanks in advance.

Pedro.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: MPO format (3D)

Post by magick »

We have no plans to support the MPO image format. However, ImageMagick is open-source so anyone can write a coder to read and/or write an image format and contribute it to the ImageMagick project.
Bill.Costa

Re: MPO format (3D)

Post by Bill.Costa »

I'm also interested in using MPO files in ImageMagick and am a programmer by profession. Can you point me to documentation that provides guidelines for creating a "coder" module?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: MPO format (3D)

Post by fmw42 »

I am not an expert on coding, but you could look at:

http://www.imagemagick.org/script/archi ... php#coders

and

viewtopic.php?f=4&t=11884

until someone with more IM coding knowledge than I responds.
sanmai

Re: MPO format (3D)

Post by sanmai »

To those who interested, exiftool can be used to extract pairs from the .MPO:

Code: Select all

exiftool -trailer:all= input.mpo -o R.jpg
exiftool input.mpo -mpimage2 -b > L.jpg
And then:

Code: Select all

composite -stereo L.jpg R.jpg stereo.jpg
via brainwagon.org
Aplonis
Posts: 3
Joined: 2008-09-11T12:10:58-07:00

Re: MPO format (3D)

Post by Aplonis »

Here's what I wrote for myself to use with my FujiFilm FinePix W3 camera.
It's a Perl script requireing no modules to be isntalled, but calling both ExifTool and ImageMagick in turn to generate full-color, full-size, cross-eye stereographs in JPEG format from a whole directory of MPOs. Use at own risk.

Code: Select all

#!/usr/bin/perl -w
# Version 2013-10-11 by Gan Uesli Starling
# A program to separate MPO files into cross-eye stereo pairs.
# Requires both ExifTool and ImageMagick to be installed in system.
# Offered without warrantee or guarantee of any kind whatsoever. Use at own risk.

# Get a list of all *.MPO files, then split & rejoin each one.
sub parse_files {
    my ($dir, $re_hunt, $geometry) = @_;
    my @file_list = hunt_files($dir, $re_hunt);
    for my $mpo (@file_list) {
        for ( "R.jpg", "L.jpg") {unlink $_};
        my $stereo = 'X_' . $mpo;
        $stereo =~ s{\.(mpo|MPO)$}{.jpg};
        print "Splitting $mpo\n";
        system("exiftool -trailer:all= $mpo -o ./R.jpg");
        system("exiftool $mpo -mpimage2 -b > ./L.jpg");
        system("montage -tile 2x0 -geometry $geometry R.jpg L.jpg $stereo");
        #last;
    }
}

# Return a lists of files from path that match a RegEx.
sub hunt_files {
    my ($path, $re) = @_;
    my @list;
    opendir ( my $dh, $path ) || die "Error in opening dir $path\n";
    while( (my $file = readdir( $dh ))){
         push @list, $file if $file =~ m/$re/;
    }
    closedir($dh);
    return @list;
}

parse_files('./', '^.*.(mpo|MPO)$', '3584x2016');

print "All done!\n";

sleep 5;
Post Reply