Skip to main content

Image magick

PhotoJoiner


     Khi dịch ngược các app Android hay các file ảnh dùng cho CSS, nhiều ảnh nhỏ hay được ghép thành 1 ảnh to. Khi dùng thì crop theo vị trí. Như vậy tiết kiệm nhiều thứ. Tool online lẫn Desktop mình nghĩ có nhiều để làm việc này, đơn cử như PS, Gimp, online có photojoiner.net ...
montage 2015-04-08*.png -tile 3x3 -geometry +0+0 out.png
Ghep anh theo 3 hang x 3 cot.
Thực tế muốn sort ảnh theo size width x height trước khi join.
Có thể dùng bash sort rồi >> ra file name thứ tự theo size WxH, rồi montage. 

Create text image


Lỗi font nè:
convert -font /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -pointsize 48 -size 400 caption:ひゃ text.png

 Tuỳ ngôn ngữ mà chọn font nha.

 Other colors:
  i. green:

convert -font /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -background white -size 60x60 -fill "#aabb00"  -pointsize 36 -gravity center caption:ひょ hira_ho.png
ii. orange
convert -font /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -background grey -size 60x60 -fill orange  -pointsize 36 -gravity center caption:ひょ hira_hora_orange.png



-gravity:
convert temp.jpg -gravity North -pointsize 30 -annotate +0+100 'Love you mom' temp1.jpg
http://www.imagemagick.org/script/command-line-options.php?#gravity

http://www.imagemagick.org/Usage/text/

Create a sentence image:

convert -font /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -background grey -size 420x100 -fill "#aabb00"  -pointsize 36 -gravity North caption:ワイルドサイドの友達に hira_wairudo_grey2.png


Annotate for image:
convert hira_wairudo_grey2.png -font /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -fill "#aabb00"  -pointsize 24 -gravity South -annotate +0-24 'Wairudosaido no tomodachi ni' hira_wairudo_grey2.png




The bash is awesome and fast, but when I need more logic and text processing it become hard for me to done job only with bash. So I make some PHP script here:

https://github.com/dungnv53/Hittie/blob/master/Code/php/sakura.php
PHP automate generate text button image

In above script, I create a list of image button with japanese character in center and annotation in romanji in the south (the vowel store in an array like 'ba' => 'が'). Here some result:






I know some site have this tool (u google button image generator), and some of this has API. But I still likely to solve it in my way.

I make a simple game for learn japanese alphabet Hiragana and katakana. It use button image generated by above script. You can install here:
https://play.google.com/store/apps/details?id=com.littlewing.genjitakya.app

Comments

  1. convert input_file -background transparent -extent '18x18' output_file

    ReplyDelete

Post a Comment

Popular posts from this blog

Some audio tool for Karaoke track making

https://www.theverge.com/2019/11/5/20949338/vocal-isolation-ai-machine-learning-deezer-spleeter-automated-open-source-tensorflow https://moises.ai/ https://www.starmakerstudios.com/instrumental/help/upload Obviously Adobe AfterEffect or alternative tool is required (?). Youtube have subtitle seem good too.

Rand mm 10

https://stackoverflow.com/questions/2447791/define-vs-const Oh const vs define, many time I got unexpected interview question. As this one, I do not know much or try to study this. My work flow, and I believe of many programmer is that search topic only when we have task or job to tackle. We ignore many 'basic', 'fundamental' documents, RTFM is boring. So I think it is a trade off between the two way of study language. And I think there are a bridge or balanced way to extract both advantage of two method. There are some huge issue with programmer like me that prevent we master some technique that take only little time if doing properly. For example, some Red Hat certificate program, lesson, course that I have learned during Collage gave our exceptional useful when it cover almost all topic while working with Linux. I remember it called something like RHEL (RedHat Enterprise Linux) Certificate... I think there are many tons of documents, guide n books about Linux bu

Martin Fowler - Software Architecture - Making Architecture matter

  https://martinfowler.com/architecture/ One can appreciate the point of this presentation when one's sense of code smell is trained, functional and utilized. Those controlling the budget as well as developer leads should understand the design stamina hypothesis, so that the appropriate focus and priority is given to internal quality - otherwise pay a high price soon. Andrew Farrell 8 months ago I love that he was able to give an important lesson on the “How?” of software architecture at the very end: delegate decisions to those with the time to focus on them. Very nice and straight-forward talk about the value of software architecture For me, architecture is the distribution of complexity in a system. And also, how subsystems communicate with each other. A battle between craftmanship and the economics and economics always win... https://hackernoon.com/applying-clean-architecture-on-web-application-with-modular-pattern-7b11f1b89011 1. Independent of Frameworks 2. Testable 3. Indepe