#!/usr/bin/perl
use strict;
use warnings;
use Image::Size;
use File::Temp qw/tempdir/;
use File::Spec;
my $tempdir = tempdir (CLEANUP => 1);
my @files = grep (/\.tif$/i, @ARGV);
my @args = grep (!/\.tif$/i, @ARGV);
exit unless @files;
my $stub0 = $files[0];
$stub0 =~ s/\.tif$//i;
my $stub1 = $files[-1];
$stub1 =~ s/\.tif$//i;
$stub1 =~ s/.*(\/|\\)//;
my ($width, $height) = imgsize ($files[0]);
open (SVG, ">$stub0-$stub1.svg");
print SVG qq|
|
__END__
=head1 NAME
tif2svg - generates an SVG file from hugin 'multiple TIFF' output
=head1 Synopsis
tif2svg [options] INPUT INPUT ...
=head1 DESCRIPTION
Takes a list of TIFF files and assembles an SVG file with each TIFF referenced
on a separate layer.
If the --trace option is given, alpha channels are traced with 'autotrace' and
this vector path is inserted as clip paths.
Typically, multiple TIFF output is generated by hugin/nona, instead of adjusting
alpha channels for enblend, this tool allows the masks to adjusted in Inkscape
instead. The saved SVG file can be blended with 'enblend-svg'.
Requires Image::Size and autotrace.
L
Note that the 'multiple TIFF' files can be large and unwieldy, use the
--jpeg-proxies option to generate JPEG versions for use in Inkscape.
'enblend-svg' will swap these back when blending.
=head1 License
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
=head1 See Also
L, L
=head1 Author
September 2007, Bruno Postle