ユーザ用ツール

サイト用ツール


サイドバー

最新の10件
一覧
unix:imagemagick

Imagemagick

比較明合成

星景写真などでよく使うやつ

https://www.flickr.com/photos/matoken/20717829351/in/dateposted/ https://www.flickr.com/photos/matoken/20717954681/in/photostream/

以前こんな感じで軌跡が消えてしまうとかやっていたのだけど,

$ composite -compose lighten 画像* 出力画像

以下のように1枚ずつ合成するとok

$ composite -compose lighten 画像1 画像2 出力画像
$ composite -compose lighten 画像3 出力画像 出力画像
$ composite -compose lighten 画像4 出力画像 出力画像
$ composite -compose lighten 画像5 出力画像 出力画像
SYNOPSIS
       composite-im6.q16 [ options ... ] change-file base-file [ mask-file ] output-image

枚数が多いと時間が掛かる 中間ファイルを .jpg, .png, .bmp で試すと.bmpの処理時間を1として.jpgが1.3倍,.pngが9倍ちょっとの時間がかかった.

.bmpで変換した後.jpgなりに変換するのが良さそう.

変換script例

#!/usr/bin/perl
use strict;
use warnings;

my $out="out_lighten.bmp";

my @list= glob('IMGP????.JPG');
my $N=$#list+1;
my $i=0;

foreach my $file (sort @list) {
  $i++;
  if ($i == 1) {
    print "\n#$i/$N cp $file $out\n";
    my @args = ( "convert", $file, $out );
    system(@args) == 0
      or die "system @args failed: $?";
  } else {
    print "#$i/$N composite -compose lighten $file $out $out\n";
    my @args = ( "composite", "-compose", "lighten", $file, $out, $out );
    system(@args) == 0
      or die "system @args failed: $?";
  }
}

コメント

コメントを入力. Wiki文法が有効です:
   __    ____  ____    ___    ___ 
  / /   /  _/ / __ \  / _ \  / _ \
 / /__ _/ /  / /_/ / / , _/ / // /
/____//___/  \___\_\/_/|_| /____/
 
unix/imagemagick.txt · 最終更新: 2019/09/25 17:06 by matoken