YoyaMagick 㧠Image::Magick (PerlMagick)
ã¦ã¼ã¶ã¼ã©ã³ãã«YoyaMagickãããã¦ãplenvã§ãããææ°çã®Perlã«ãã®YoyaMagickã®Image::Magick(PerlMagick)ãå ¥ãã¦ãã¢ãã¡ã¼ã·ã§ã³Gifããªãµã¤ãºãããã®ãµã³ãã«ãåããã¾ã§ã®æé ãç´¹ä»ãã¾ãã
ãã¾ãé£ãããã¹ãã¯ãã¦ããªãã®ã§ãå®å ¨ã«åä½ãã¦ãããã¯ãããã¾ãããã
@yoyapp ãããã¨ããããã¾ãï¼å®éã®æyoyaMagickã¯å ¨ãæªãããã¾ãããåã®ã¹ãã«ããã¡ãªã®ã§Image::Magickç³»ãéè¯ã§buildããã¨ãããªãããªã®ã§ï¼ããã«ã½ã³ã®æä¸ã ã£ãã®ã§ï¼éããã ãã§ãâ¦ã
— uzulla (@uzulla) 2013å¹´6æ18æ¥
@yoyapp ã¡ããã¨ã¾ã¨ãã¦ãè¿ããã¡ããã°ã«ã§ããããã¦ããã ãã¾ãããã
— uzulla (@uzulla) 2013å¹´6æ18æ¥
ã¨ããã¦ãã¾ã£ãããã«ã¯ããã£ãæé ãããã¯ããã°ã«ãããªãã¨ãã°ãã§ããã¨ãããã¨ã§æ¸ãã¾ããã
å説:YoyaMagickã¨ã¯
https://github.com/gree/YoyaMagick
http://labs.gree.jp/blog/date/2013/05/
ã¢ãã¡ã¼ã·ã§ã³Gifãæ±ãå ´åã«ããã¦ãImageMagickãããé«éã§ãImageMagickã¨ï¼ãã¡ã¤ã«åããREADMEã¾ã§wï¼ã³ã³ããã§ãGraphicsMagick*1ãããé«å質ãã¨ããæããªãã®ã§ãã
ã§ããæ£ç´ãªæãç§ã¯ãã³ããã¼ã¯ã¨ããã¦ãªããã§ããã³ãã¼ã«éããã¨ãããã³ãã¼ã«ç¶ºéºãã¨ãã¯ãçãããã¡ããã確èªãã¦ããããããã°ã«æ¸ãã¾ããããåã¯ãããã¼ï¼ã¯ãããã ï¼ç¶ºéºãªãã ï¼ãã£ã¦éµåã¿ã«ãã¦å
¥ãã¾ããï¼
è¨ç½®å ãã£ã¬ã¯ããªã®åæ
~/yoya/ é©å½ãªãã¡ã¤ã«ç½®ãå ´
~/opt/ YMãautoconfã®ãã¼ã«ã«ã¤ã³ã¹ãã¼ã«å
ä¸æºåã«ã¤ãã¦
libjpegãlibpngãªã©ããã¦ããã¾ããã
#centOS
yum install libjpeg* libpng*
#Debç³»ï¼ãããä»ãªãUbuntuç³»ã¨ããã¹ããï¼
apt-get install libjpeg-dev libpng-dev ï¼ã ã£ãããªï¼
ï¼å¾è¿°ã®YoyaMagickã®configureçµæã§ããããã®ã©ã¤ãã©ãªã®supportãã§ãã®ã§ãã¡ããã¨è¦ã¦ããã¾ãããï¼
Perlã«ã¤ãã¦ã¯ãããªããYoyaMagickããã«ãããåã«plenvãªã©ã§ãå¿
è¦ãªPerlãããã¦è¨å®ãçµãããã¦ããã¾ãã
plenvï¼https://github.com/tokuhirom/plenv
plenvã®ãå½¹ç«ã¡ã¹ã¯ãªããã¯ãã¡ã http://yellowstore.blogspot.jp/2013/05/plenvrbenv.html
CentOSerã«ã¯ã追å ã§å¿ è¦ãªä¸æºå
ä»åã¯ç§ã¯CentOS 6.4ãã¤ããã¾ãããCentOSã¯ææ°ãã¼ã¸ã§ã³ã§ãautoconfã®ãã¼ã¸ã§ã³ã2.63ã¨å¤ãã®ã§ãgnuã®ãµã¤ãããLatestãªããã¨ã£ã¦ãã¦ãããå¿
è¦ãããã¾ãã
å¥ã«ã°ãã¼ãã«ã«å
¥ããå¿
è¦ããªãã®ã§ãããããã¼ã«ã«ã«å
¥ãã¦ãã¾ãã¾ãã
cd ~/yoya/
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar xvzf autoconf-latest.tar.gz
cd autoconf-2.69/
configure --prefix=$HOME/opt/
make all
make install
autoconfããã¼ã«ã«ã«ãããããPathãå ã«æ¥ãããã«ãã¾ããããã
export PATH=$HOME/opt/bin:$PATH
ãã«ãä½æ¥ã®éã ãå¹ãã¦ããã°ããã®ã§ã.bash_profileã¨ãã«æ¸ããªãã¦ãè¯ãã§ãã
autoconfããããã¨ãã«ãããããã¦ææ°çã®M4ãå¿ è¦ããããã¾ãã
cd ~/yoya/
wget http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz
tar xvzf ã
configure --prefix=$HOME/opt/
make all
make install
export M4=$HOME/opt/bin/m4 #å¿ è¦ã ã£ããããªâ¦
ã¾ããããã¸ãã¯ã°ã°ãã°ã§ã¦ãã¾ãã
YoyaMagickã®ãã«ã
ããããã¯ããã§ãã
cd ~/yoya/
git clone https://github.com/gree/YoyaMagick
cd YoyaMagick
./configure --prefix=$HOME/opt --with-perl
make all
make install
(ããã¾ã§ã§YoyaMagickã®ã³ãã³ãã¤ã³ã¹ãã¼ã«å®äºããã以ä¸Image::Magickã®ã¤ã³ã¹ãã¼ã«ï¼
cd PerlMagick
perl Makefile.PL
make
make install
ãã£ããã§ããã*2
ã¡ãªã¿ã«ã
`pm_to_blib' ã«å¿ è¦ãªã¿ã¼ã²ãã `Q16.pm' ã make ããã«ã¼ã«ãããã¾ãã.
ã¿ãããªãã¨ãè¨ãããããã¦makeã§å¤±æããæã¯ãYoyaMagick
ã®configure ã§ã--with-perlãã¡ããã¨ã¤ãã¦ããã確èªãã¾ãããã
é©å½ãªã³ã¼ãã§ãã¹ããã¦ã¿ã
ããã§Image::Magickãã¤ã³ã¹ãã¼ã«ãããã¯ãã§ãã®ã§ããã¹ãã§ãã
#!/usr/bin/env perl use Image::Magick; $p = new Image::Magick; $p->Set(size=>'10x10'); $p->ReadImage('canvas:white'); $p->Set('pixel[5,5]'=>'red'); $p->Write("test.jpg");
test.jpgã¨ããçã£ç½ã®ä¸å¿ã«èµ¤ã1ãããæã£ããã¡ã¤ã«ãçæããã¾ãã
ç¹ã«ã¨ã©ã¼ãã§ãªãã£ããã大ä¸å¤«ã§ãããã
ã¢ãã¡ã¼ã·ã§ã³Gifããã©ãã¦ã¿ã
wget -O moz.gif "http://medias.gifboom.com/medias/[email protected]#" #*3
mkdir tmp/
perl yoya2.pl #yoya2.plã¯å¾è¿°
ls tmp/
ï¼ããããã®JPGãâ¦ï¼
yoya2.pl
#!/usr/bin/env perl use Image::Magick; $p = new Image::Magick; $p->ReadImage('moz.gif'); $p->Write("tmp/test%03d.jpg");
ã¢ãã¡ã¼ã·ã§ã³Gifãçµã¿ç«ã¦ã¦ã¿ããã¤ãã§ã«ãªãµã¤ãºã
perl yoya3.pl # yoya3.plã¯å¾è¿°
open moz2.gif # moz2.gifãåºæ¥ã¦ãã®ã§é©å½ã«
yoya3.pl
#!/usr/bin/env perl use Image::Magick; $p = new Image::Magick; $p->ReadImage('tmp/test*.jpg'); $p->Resize( geometry => "50x50", ); $p->Write("moz2.gif");
ã©ãã§ããï¼åé¡ãªãã§ããï¼
ãã¦æåã«ãã³ããã¼ã¯ã¨ã£ã¦ãªãã£ã¦æ¸ãã¾ãããã©ãYoyaMagickå®ééãæ°ããã¾ãã
å質ã¯ã©ããªãã§ããããï¼GraphicsMagickãããã¾ã¤ãã£ã¦ãªãã®ã§ãããããããªãã
ããããã®ã¯ä»ã®äººã«è²ãã¾ãã
ããã¦ãä»åå
¥ããImage::Magickãååã®Hachioji.pmããã«ã½ã³( http://hachiojipm.org/?p=535 )ã®æã«ã¯æ¦ç¥çæ¤éã§convertã³ãã³ãã使ãããã«ãã¾ãããããããã«ã³ãã³ãã¨éã£ã¦æ¡å¤§ç¸®å°å転æ¸è²èªç±èªå¨ã§ãããã§ã¼æ¥½ã«è²ã
ã§ãã¦ãã§ã¼æ¥½ããã
Pyazo( https://github.com/uzulla/pyazo ) ã«iPhoneãããããªï¼MP4ï¼ãæ稿ããã¨é¢ç½ããã¨ããäºã«æ°ã¥ããã®ã§ï¼ããããªããããµã¤ãºãã¤ããã¦äººãæ»ã¬ï¼ãããããå¤æããã®ã«ãããããã§ããã¾ãã
ã¾ãYoyaMagickãã¤ãã£ã¦ãã£ã¦ã ãã§ã俺ã¯ImageMagickã¨ãé ãã¦ã¤ãã£ã¦ãªããï¼ãGraphicsMagickã¨ãç»è³ªããããã¦ã¤ãã£ã¦ãããªããï¼ãã¨ããã¤é¡ã§ããããããã¾ããããå®éãã®éã®ããã«ã½ã³ã§ãã¾ããã®ã§ãæºè¶³ã§ãããããã¨ããããã¾ã>ä½è æ§
ããã¿ãªãããããã§é«éã«ã¢ãã¡ã¼ã·ã§ã³Gifã¨ããçæãã¾ããã¾ãã®ã§ãç¡é§ã«ãã¡ã¤ã«ãµã¤ãºã°ããã§ããç«ã®Gifã§ãä½ã£ã¦ã¬ã³ã¬ã³ã¢ãããã¼ããã¾ãããããããªæã®ã¤ã³ãã©æ å½è ã®æ¹ã ããåªè©ãã¯ããã¾ããã¾ãããã
ããã
æè¿ãããã¦ã宣ä¼
http://tailf.cfe.jp/â¨ããªãã®InstagramãFacebookãGoogle+ï¼Picasaï¼ã®ç»åããTOLOTãã©ãããã¯ï¼http://tolot.com/ï¼ç¨ã®ãã¼ã¿ã«è¶
ã«ã³ã¿ã³å¤æãã¾ãã
500åã§62æã®ãã©ãããã¯ã¯å代æªèã®å®ãã¨ãããã¾ãã®ã§ãæ¯éã
ã©ãã§ãããã§ããã©ãæè¿Google+ã®ã¢ã«ãã ãè¶
絶使ãããããªã£ã¦ã¦ããã§ããã
ãªãªã¼ã¹æã®è©³ç´°ã¨ã³ããª
Youtubeã«ããã£ã¦ãããå©ç¨è ã®ã¬ãã¼ã
TAILFã§instagramãã©ãããã¯ãä½ããï¼ - YouTube