Slide 1

Slide 1 text

ը૾Ճ޻αʔόΛ࡞ͬͯΈΑ͏ Լॏതࢿ(.01FQBCP *OD ৽ଔΤϯδχΞݚम࠲ֶ *NBHF.BHJDL࣮ફೖ໳

Slide 2

Slide 2 text

ΤϯδχΞ ೥౓ೖࣾɾ৽ଔظ Լॏതࢿ!TIJNPKV@ &$ࣄۀ෦46;63*νʔϜ TIJNPKVPSH

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

͓͠ͳ͕͖ wࠓ೔ͷΰʔϧ w46;63*ͱը૾ॲཧ w*NBHF.BHJDLΛ৮ͬͯΈΑ͏ wը૾Ճ޻αʔόΛ࡞ͬͯΈΑ͏

Slide 6

Slide 6 text

ࠓ೔ͷΰʔϧ w*NBHF.BHJDLΛ࢖༻ͨ͠ը૾Ճ޻Λ΍ͬͯΈͯɺ wը૾ॲཧͨͷͦ͠͏ʂͬͯͳΔ͜ͱ wഎޙʹ͋Δ਺ࣜ΍ɺମܥతͳཧղͷͨΊͷཧ࿦ʹ͍ͭ ͯ͸ ൃදऀͷ஌ࣝෆ଍ʹΑΓ ѻ͍·ͤΜ

Slide 7

Slide 7 text

46;63*ͱը૾ॲཧ

Slide 8

Slide 8 text

46;63*ͱը૾ॲཧ wΞοϓ͞Εͨը૾ΛΞΠςϜը૾ ͱ߹੒ͯ͠αϜωΠϧΛ࡞Δ w5γϟπͷγϫʹ߹Θͤͯը૾Λ มܗ σΟεϓϨΠεϝϯτϚο ϐϯά ͤͨ͞Γ wӨΛ͚ͭͨΓ৭Λม׵ͨ͠Γ

Slide 9

Slide 9 text

46;63*ͱը૾ॲཧ wΞοϓ͞Εͨը૾ΛΞΠςϜը૾ ͱ߹੒ͯ͠αϜωΠϧΛ࡞Δ w5γϟπͷγϫʹ߹Θͤͯը૾Λ มܗ σΟεϓϨΠεϝϯτϚο ϐϯά ͤͨ͞Γ wӨΛ͚ͭͨΓ৭Λม׵ͨ͠Γ

Slide 10

Slide 10 text

*NBHF.BHJDLΛ ৮ͬͯΈΑ͏

Slide 11

Slide 11 text

ͱΓ͋͑ͣΠϯετʔϧ $ brew install imagemagick OR $ sudo apt-get install -y imagemagick OR $ sudo yum -y install ImageMagick

Slide 12

Slide 12 text

*NBHF.BHJDL wը૾Ճ޻ͱ͍͑͹͜Εͱ͍͏༗໊ϥΠϒϥϦ wϝδϟʔ͔ΒϚΠφʔ·Ͱ͞·͟·ͳը૾ܗࣜʹରԠ wػೳ͕ଟ͗ͯ͢੬ऑੑ΋ͨͼͨͼൃݟ͞ΕΔ͘Β͍ʜ w$Ͱ࣮૷͞Εɺଟ͘ͷݴޠͰόΠϯσΟϯά͕͋Δ w3VCZɿSNBHJDL NJOJ@NBHJDLHFN w1)1ɿ*NBHJDL֦ுϥΠϒϥϦͳͲ

Slide 13

Slide 13 text

ίϚϯυ wJNBHFNBHJDLͱ͍͏ίϚϯυ͸ͳ͍   wػೳ͝ͱʹDPOWFSU΍JEFOUJGZͳͲͷίϚϯυʹΘ͔Ε͍ͯΔ wͨͩ͠ɺ*NBHF.BHJDL͔Β͸͢΂ͯNBHJDLίϚϯυ΁ͷγϯϘ ϦοΫϦϯΫʹͳ͍ͬͯΔ

Slide 14

Slide 14 text

*NBHF.BHJDL 6CVOUV $ ls -Alh /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16 total 88K -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 animate -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 compare -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 composite -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 conjure -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 convert -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 display -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 identify -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 import -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 mogrify -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 montage -rwxr-xr-x 1 root root 6.3K Jul 31 13:22 stream

Slide 15

Slide 15 text

*NBHF.BHJDL .BD)PNFCSFX $ ls -Alh /usr/local/Cellar/imagemagick/7.0.7-7/bin | grep -v config total 64 lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 animate -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 compare -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 composite -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 conjure -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 convert -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 display -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 identify -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 import -> magick -r-xr-xr-x 1 shimoju admin 18K 10 9 18:25 magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 magick-script -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 mogrify -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 montage -> magick lrwxr-xr-x 1 shimoju admin 6B 10 7 21:02 stream -> magick

Slide 16

Slide 16 text

JEFOUJGZ wը૾ͷ৘ใΛग़ྗͰ͖Δ wαΠζΛͬ͞ͱ஌Γ͍ͨͱ͖ͱ͔ɺ wେྔͷը૾ͷத͔ΒαΠζ͕ҧ͏΋ͷΛ୳ͨ͠Γͱ͔

Slide 17

Slide 17 text

JEFOUJGZ $ identify *.jpg original.jpg JPEG 800x533 800x533+0+0 8-bit sRGB 104823B 0.000u 0:00.000 resize.jpg JPEG 400x267 400x267+0+0 8-bit sRGB 37116B 0.000u 0:00.000 ϑΥʔϚοτจࣈྻ͸͜͜Β΁Μࢀরɿhttps://www.imagemagick.org/script/escape.php $ identify -format '{"width": %w, "height": %h}' *.jpg | jq { "width": 800, "height": 533 } $ identify -format '%wx%h %f\n' *.jpg | grep -v 800x533 200x200 crop.jpg

Slide 18

Slide 18 text

DPOWFSU w͞·͟·ͳը૾Ճ޻Λߦ͑Δɺ*NBHF.BHJDLͷϝΠϯίϚϯυ wҎ߱͸͢΂ͯDPOWFSUίϚϯυΛѻ͍͖ͬͯ·͢

Slide 19

Slide 19 text

ద౰ͳը૾Λ༻ҙ͠·͢ ਖ਼ํܗ͡Όͳ͍΄͏͕͍͍Ͱ͢ɻ͜ͷը૾͸YQY ग़యɿIUUQTXXXQBLVUBTPDPNQPTUIUNM

Slide 20

Slide 20 text

ճస SPUBUF ճస $ convert -rotate 90 original.jpg rotate.jpg ্Լ൓స $ convert -flip original.jpg flip.jpg ࠨӈ൓స $ convert -flop original.jpg flop.jpg ্Լࠨӈ൓స $ convert -flip -flop original.jpg flipflop.jpg

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

αϯϓϧ TBNQMF ϐΫηϧΛؒҾ͘ $ convert -sample 10% original.jpg sample.jpg 10%ʹͳΔΑ͏ʹϐΫηϧΛؒҾ͍ͨ͋ͱɺ1000%ʹͳΔΑ͏ʹ֦େ →ݩը૾ͱಉ͡αΠζͰϞβΠΫ͕͔͔Δ $ convert -sample 10% -sample 1000% original.jpg sample.jpg

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

ϦαΠζ SFTJ[F σϑΥϧτͰ͸ΞεϖΫτൺΛม͑ͳ͍ɿࢦఆͨ͠෯ɾߴ͞ʹऩ·ΔΑ͏ʹϦαΠζ͞ΕΔ $ convert -resize 400x400 original.jpg resize.jpg $ identify resize.jpg resize.jpg JPEG 400x267 400x267+0+0 8-bit sRGB 37116B 0.000u 0:00.000 !Λ͚ͭΔͱΞεϖΫτൺΛແࢹͯ͠ࢦఆͨ͠஋ʹϦαΠζ͢Δ $ convert -resize 400x400! original.jpg resize2.jpg ෯·ͨ͸ߴ͞ͷΈࢦఆͰ͖Δ $ convert -resize 400x original.jpg resize3.jpg

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Τοδݕग़ FEHF ෆ࿈ଓʹมԽ͍ͯ͠ΔՕॴΛݕग़͢Δ $ convert -edge 5 original.jpg edge.jpg ஋ΛมԽͤͯ͞ΈΑ͏ $ convert -edge 10 original.jpg edge.jpg $ convert -edge 1 original.jpg edge.jpg

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

੾Γൈ͖ DSPQ -gravityͰج४఺Λࢦఆ -crop widthxheightͰ੾Γൈ͘αΠζΛࢦఆ +/-Ͱج४఺͔Βͷx,y࠲ඪΛࢦఆ $ convert -gravity center -crop 200x200+0+0 original.jpg crop.jpg ը૾ӈ্Λج४ʹɺxʹ140px,yʹ50pxҠಈ͠ɺͦͷ఺͔Β200x200px੾Γൈ͘ $ convert -gravity northeast -crop 200x200+140+50 original.jpg crop.jpg

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

ృΓ଍͠ FYUFOU ࢦఆͨ͠αΠζʹͳΔΑ͏ʹ༨നΛ௥Ճ͢Δ ༨നͷ৭͸-backgroundͰࢦఆͰ͖Δ ਖ਼ํܗͷαΠζ͕ඞཁͳͷʹ4:3ͷը૾͔͠ͳ͍ͱ͔ʹศར $ convert -background black -gravity center \ -extent 800x800 original.jpg extent.jpg PNG(ಁա͕ѻ͑ΔϑΥʔϚοτ)Ͱ͋Ε͹transparentͰಁաͰ͖Δ $ convert -background transparent -gravity north \ -extent 1000x1000 original.jpg extent.png

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

ͦΖͦΖ߹੒ͨ͘͠ ͳ͖ͬͯͨΑͶʁ

Slide 33

Slide 33 text

ͦͷલʹจࣈͷը૾Λ࡞͓ͬͯ͜͏ $ convert -background transparent \ -fill '#ff6060' -font Arial -pointsize 128 label:LGTM lgtm.png ࢦఆαΠζͰ࡞੒ $ convert -size 400x200 -gravity center -background transparent \ -fill '#ff6060' -font Arial -pointsize 128 label:LGTM lgtm.png

Slide 34

Slide 34 text

߹੒ DPNQPTJUF original.jpgͷ্ʹlgtm.pngΛ߹੒ͯ͠ɺcompose-over.jpgͱͯ͠ग़ྗ $ convert original.jpg lgtm.png -gravity center \ -compose over -composite compose-over.jpg -geometryͰج४఺͔ΒҠಈ $ convert original.jpg lgtm.png -gravity center -geometry +150+50 \ -compose over -composite compose-over.jpg

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

ඳըϞʔυ CMFOENPEF -composeͰඳըϞʔυΛࢦఆ͢Δ ৐ࢉ (multiply) $ convert original.jpg lgtm.png -gravity center -geometry +150+50 \ -compose multiply -composite compose-multiply.jpg ΦʔόʔϨΠ (overlay) $ convert original.jpg lgtm.png -gravity center -geometry +150+50 \ -compose overlay -composite compose-overlay.jpg ݮࢉ (subtract) $ convert original.jpg lgtm.png -gravity center -geometry +150+50 \ -compose subtract -composite compose-subtract.jpg

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

ඳըϞʔυ CMFOENPEF wॏͶΒΕͨը૾ΛͲͷΑ͏ʹ߹੒͢Δ͔ΛࢦఆͰ͖Δ w IUUQJNBHFNBHJDLSVMF[KQBSDIJWFT w1IPUPTIPQͳͲͷը૾ฤूιϑτʹ͋Δ΋ͷͱಉ༷ w࣮ࡍͲΜͳܭࢉͰࢉग़͞ΕΔ͔͸ιʔεΛಡΊ͹Θ͔Δʜ͕ɺײ֮Λ ͔ͭΉʹ͸(*.1ͷυΩϡϝϯτ͕Θ͔Γ΍͍͢ w IUUQTEPDTHJNQPSHKBHJNQDPODFQUTMBZFSNPEFTIUNM wྫʣ৐ࢉɿ߹੒ը૾ͷ৭্ଆͷ৭ Լଆͷ৭

Slide 41

Slide 41 text

ը૾Ճ޻αʔόΛ ࡞ͬͯΈΑ͏

Slide 42

Slide 42 text

-FOTɿ46;63*ͷը૾Ճ޻αʔό w46;63*Ͱ࢖͍ͬͯΔը૾Ճ޻αʔόΛʮ-FOTʯͱݺΜͰ͍Δ wը૾ॲཧʹ͸*NBHF.BHJDLΛ࢖༻ w5γϟπͷαϜωΠϧը૾ੜ੒ॲཧ͸͜͜Β΁Μ w ࣾ಺ϦϙδτϦͷ63-ͷͨΊলུ

Slide 43

Slide 43 text

-(5.(FOFSBUPS ׬੒ͯ͠ͳ͍ wͦͷ໊΋ʮ:04"406ʯ wIUUQTHJUIVCDPNTIJNPKVZPTBTPV w3&"%.&ΛಡΜͰΠϯετʔϧ͍ͯͩ͘͠͞ wॳճͷϏϧυ͸ͪΐͬͱ͕͔͔࣌ؒΓ·͢ʜʜ wϦϙδτϦ௚Լʹద౰ͳը૾Λஔ͍ͯɺ
 IUUQMPDBMIPTUJNBHFTJNBHFKQHʹΞΫηεͯ͠ΈΔ

Slide 44

Slide 44 text

(Pݴޠ w(PPHMF͕։ൃͨ͠ɺ͍ΖΜͳ΋ͷ͕ͳ͍ݴޠ ౖΒΕͦ͏  wΫϥε͕ͳ͍ɺΑͬͯܧঝ΋ͳ͍ wྫ֎͕ͳ͍ wδΣωϦΫε͕ͳ͍ wؔ਺ܕ༝དྷͷύϥμΠϜ΋ͳ͍ wෆมม਺΍0QUJPOBMɺNBQ΍pMUFSͳͲͷίϨΫγϣϯૢ࡞

Slide 45

Slide 45 text

(Pݴޠ wݴޠ࢓༷Λখ͘͢͞Δ͜ͱͰɺίϯύΠϧ͕ߴ଎Ͱशಘ΋༰қ w޲͔ͳ͍ྖҬ΋͋Δ͕ɺదͨ͠ྖҬͰ͸ҖྗΛൃش͢Δ wόΠφϦ͕ੜ੒͞ΕΔͨΊɺ$-*πʔϧ΍ϛυϧ΢ΣΞʹศར w੩తܕͷԸܙΛड͚ͳ͕Βɺܕਪ࿦ͰܕΛ໌ࣔͤͣʹ։ൃͰ͖Δ wฒߦॲཧΛߦ͏ͨΊͷݴޠ࢓༷ HPSPVUJOF ͕͋Γɺൺֱత؆୯ʹฒ ߦϓϩάϥϛϯά͕Ͱ͖Δ

Slide 46

Slide 46 text

୅දతͳιϑτ΢ΣΞ wίϚϯυϥΠϯπʔϧ wHIRɺQUɺIVHPɺOZBIDMJ wϛυϧ΢ΣΞɾαʔό w%PDLFSɺDPOTVMɺ%SPOFɺ45/4 wൺֱతখ͞ͳ ϚΠΫϩαʔϏεࢦ޲ͳ "1*αʔό wϩϦϙοϓʂϚωʔδυΫϥ΢υͷ"1*αʔό wը૾Ճ޻ɾ഑৴αʔϏε*NBHF'MVY

Slide 47

Slide 47 text

ίʔυΛಡΜͰΈΑ͏ wNBJOHP wΤϯτϦϙΠϯτɻϦΫΤετϧʔλʔ ίϯτϩʔϥʔ w4JOBUSBͳͲͷΑ͏ͳϚΠΫϩϑϨʔϜϫʔΫελΠϧ wDPOWFSUFSJNBHFHP wը૾Ճ޻Λந৅Խͨ͠ύοέʔδɻ͜͜Ͱ*NBHF.BHJDLΛར༻

Slide 48

Slide 48 text

ίʔυΛ͍ͬͯ͡ΈΑ͏ wυΩϡϝϯτΛಡΈͳ͕Β wJNBHJDLɿDPOWFSUFSJNBHFHPͰར༻ wIUUQTHPEPDPSHHPQLHJOHPHSBQIJDTJNBHJDLWJNBHJDL wHJOɿNBJOHPͰར༻ wIUUQTHPEPDPSHHJUIVCDPNHJOHPOJDHJO

Slide 49

Slide 49 text

·ͱΊ w46;63*Ͱը૾ॲཧ͕Ͳ͏࢖ΘΕ͍ͯΔ͔Λ஌ͬͨ w*NBHF.BHJDLΛ࢖ͬͨ؆୯ͳը૾Ճ޻Λ΍ͬͯΈͨ wը૾Ճ޻αʔόΛ͍ͬͯ͡Έͨ w(Pݴޠʹ৮ΕͯΈͨ

Slide 50

Slide 50 text

·ͱΊ wΰʔϧ͸ୡ੒Ͱ͖·͔ͨ͠ʁ w*NBHF.BHJDLΛ࢖༻ͨ͠ը૾Ճ޻Λ΍ͬͯΈͯɺ wը૾ॲཧͨͷͦ͠͏ʂͬͯͳΔ͜ͱ

Slide 51

Slide 51 text

͜ΕͰ܅΋ -(5.ը૾࡞Γ์୊ͩʂ