This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doc = app.activeDocument; | |
var docPath = doc.path; | |
function loadUrl(url, callback) { | |
var bt = new BridgeTalk(); | |
bt.target = 'bridge' ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Install Stylus (https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) | |
2. URL: Regular expression (https://scratch.mit.edu/projects/.*editor.*) | |
*/ | |
/* | |
* { | |
font-family: "微軟正黑體" !important; | |
} | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Accessible Info Viewer by jethrow | |
; https://autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/ | |
; Modified by tmplinshi - https://gist.github.com/tmplinshi/0fcb8655c1402a3662ac048d0d974915/ | |
#NoEnv | |
#SingleInstance, force | |
SetBatchLines, -1 | |
{ | |
WM_ACTIVATE := 0x06 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 輪郭追跡を行い,輪郭部のみに色を出力する | |
function contourDetection(contextIn, contextOut, width, height) { | |
var imgData=contextIn.getImageData(0, 0, width, height); | |
// 読み取り用ピクセルデータ(書き換えない) | |
var pixelData = new Array(width); | |
for(var i=0; i<width; ++i) { | |
pixelData[i] = new Array(height); | |
for(var j=0; j<height; ++j) { | |
pixelData[i][j] = imgData.data[4*(width*j+i)]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 二値化 | |
// canvasコンテキスト contextIn を閾値 threshold の元で二値化して contextOut に書き出す | |
// 入力画像はグレースケール画像であることを想定している(RGB値がすべて同じ) | |
// アルファ値が 0 のピクセルは閾値に関わらず白にする | |
function binarization(contextIn, contextOut, width, height, threshold) { | |
var imgData = contextIn.getImageData(0, 0, width, height); | |
var gray; | |
for(var i=0; i<imgData.width*imgData.height; ++i) { | |
if(imgData.data[4*i+3]==0) { | |
imgData.data[4*i] = 255; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// グレースケール化 | |
// canvasコンテキスト contextIn をグレースケール化して contextOut に書き出す | |
// ただしアルファ値が 0 のピクセルはそのままにする | |
function grayScale(contextIn, contextOut, width, height) { | |
var imgData = contextIn.getImageData(0, 0, width, height); | |
var gray; | |
for(var i=0; i<imgData.width*imgData.height; ++i) { | |
if(imgData.data[4*i+3]!=0) { | |
gray = 0.299*imgData.data[4*i]+0.587*imgData.data[4*i+1]+0.114*imgData.data[4*i+2]; | |
gray = Math.floor(gray); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from gi.repository import Vips | |
import sys | |
#Original points: | |
pts=[[100,100],[200,200],[300,100],[400,300],[300,400],[200,300],[100,100]] | |
im=Vips.Image.new_from_file("image_to_be_masked.v") | |
#Extremas: | |
min=[pts[0][0],pts[0][1]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import gi | |
gi.require_version('Vips', '8.0') | |
from gi.repository import Vips | |
im = Vips.Image.new_from_file(sys.argv[1], access = Vips.Access.SEQUENTIAL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# untile a dzsave --layout dz level | |
# tiles are expected to be named as ARG/x_y.jpeg, so use as: | |
# | |
# untile-dz.py ~/pics/somepyramid_files/11 out.jpg | |
# | |
# to make out.jpg, level 4 of somepyramid reassembled | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# untile a dzsave --layout google level | |
# tiles are expected to be named as ARG/y/x.jpg, so use as: | |
# | |
# untile-google.py ~/pics/somepyramid/4 out.jpg | |
# | |
# to make out.jpg, level 4 of somepyramid reassembled | |
NewerOlder