Skip to content

Instantly share code, notes, and snippets.

@yoya
yoya / cmyk.sh
Created July 27, 2017 10:01
CMYK multiply compose
convert -size 400x400 xc:white -fill "#0ff" -draw "rectangle 25,125 225,325" c.png
convert -size 400x400 xc:white -fill "#f0f" -draw "rectangle 75,25 275,225" m.png
convert -size 400x400 xc:white -fill "#ff0" -draw "rectangle 175,75 375,275" y.png
convert -size 400x400 xc:white -fill "#888" -draw "rectangle 127,175 320,375" k.png
composite c.png -compose multiply m.png cm.png
composite cm.png -compose multiply y.png cmy.png
composite cmy.png -compose multiply k.png cmyk.png
@yoya
yoya / ai_extract.sh
Last active September 7, 2017 09:48
AI (Adobe Illustrator) BitmapImage & Text Extractor.
#! /bin/sh
# AI (Adobe Illustrator) BitmapImage & Text Extractor.
# only "PDF compatible":true
# (c) 2017/09/07- [email protected]
# require)
# % brew install fswatch poppler epstool
# execute) MacOS
# % fswatch -0 ~/QUANT/working | xargs -0 -n 1 sh ./ai_extract.sh
# test)
# % cp -r AIFiles/* ~/QUANT/working/.
@yoya
yoya / rygb-grad.php
Created October 26, 2017 01:43
RYGB gradation Image Generator
<?php
$width = 255;
$height = 4;
$im = imagecreatetruecolor($width, $height);
for ($x = 0 ; $x < $width ; $x++) {
$r = imagecolorallocate($im, $x, 0, 0);
@yoya
yoya / circle.svg
Created March 7, 2018 05:34
approximation of circle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yoya
yoya / delegates.xml
Created April 12, 2018 17:31
ImageMagick delegate for HEIC
<delegatemap>
+ <delegate decode="heic" command="&quot;heif-convert&quot; &quot;%i&quot; &quot;%o.png&quot; ; /bin/mv &quot;%o.png&quot; &quot;%o&quot;"/>
@yoya
yoya / aperture_grille.php
Last active June 2, 2018 10:24
aperture grille SVG
<?php
/*
* (c) 2017/08/21- [email protected]
* $ composer require yoya/php-svg
*/
require_once("vendor/autoload.php");
use SVG\SVGImage;
use SVG\Nodes\Structures\SVGStyle;
use SVG\Nodes\Structures\SVGDefs;
@yoya
yoya / shadow_mask.php
Last active June 2, 2018 15:40
shadow mask SVG
<?php
/*
* (c) 2017/08/20- [email protected]
* $ composer require yoya/php-svg
*/
require_once("vendor/autoload.php");
use SVG\SVGImage;
use SVG\Nodes\Structures\SVGStyle;
@yoya
yoya / slot_mask.php
Last active June 2, 2018 10:23
slot mask SVG
<?php
/*
* (c) 2017/08/21- [email protected]
* $ composer require yoya/php-svg
*/
require_once("vendor/autoload.php");
use SVG\SVGImage;
use SVG\Nodes\Structures\SVGStyle;
use SVG\Nodes\Structures\SVGDefs;
@yoya
yoya / pentile_rybg.php
Last active June 2, 2018 10:23
pentile rybg SVG
<?php
/*
* (c) 2017/08/21- [email protected]
* $ composer require yoya/php-svg
*/
require_once("vendor/autoload.php");
use SVG\SVGImage;
use SVG\Nodes\Structures\SVGStyle;
use SVG\Nodes\Structures\SVGDefs;
@yoya
yoya / pentile_rgb.php
Last active June 2, 2018 06:47
pentile rgb SVG
<?php
/*
* (c) 2017/08/21- [email protected]
* $ composer require yoya/php-svg
*/
require_once("vendor/autoload.php");
use SVG\SVGImage;
use SVG\Nodes\Structures\SVGStyle;
use SVG\Nodes\Structures\SVGDefs;