Skip to content

Instantly share code, notes, and snippets.

View Arahnoid's full-sized avatar

Igor Grinchesku Arahnoid

  • Chernivtsi, Ukraine
View GitHub Profile
@Arahnoid
Arahnoid / gist:6a16c3c813f0bc4c8dca
Last active April 21, 2019 22:56 — forked from keriber/gist:fd8246589145d428fd2f
[Photomerge multiple images ]Photomerge multiple images in Photoshop CC using JavaScrip#Photoshop
//This will be the direcotry of the images
var workFolder = Folder("Z:/Bermudez-Hernandez/Strains Project/Animals/C57_20/Prox1_NeuN/Slide2");
var folders = workFolder.getFiles();
runphotomergeFromScript = true;
//runphotomergeFromScript = true;
$.evalFile( "C:/Program Files/Adobe/Adobe Photoshop CC/Presets/Scripts/Photomerge.jsx")
//photomerge.createPanorama(
//fileList, displayDialog );
psdOpts = new PhotoshopSaveOptions();
@Arahnoid
Arahnoid / ps-rotating-sprite.js
Created November 5, 2015 20:04 — forked from phalkunz/ps-rotating-sprite.js
Photoshop script for preparing a sprite for rotating animation
/**
* Photoshop script for preparing a sprite for rotating animation.
* Input : a starting sprite and number of frames
* Output: the specified number of layers ready to be used in the PS animation tool
*/
var docRef = app.activeDocument;
var activeLayer = docRef.activeLayer;
var degToRotate = null;
var newLayer = null;
@Arahnoid
Arahnoid / export_script.js
Last active April 21, 2019 23:19 — forked from itamar/export_script.js
[Groups to PNG] Export photoshop groups to different PNG files #Photoshop
#target photoshop
function main(){
if(!documents.length) return;
var doc = activeDocument;
var oldPath = activeDocument.path;
for(var a=0;a<doc.layerSets.length;a++){
activeDocument.activeLayer = activeDocument.layers.getByName(doc.layerSets[a].name);
dupLayers();
var saveFile= File(oldPath +"/"+doc.layerSets[a].name +".png");
SavePNG(saveFile);
@Arahnoid
Arahnoid / grid_builder.js
Created November 5, 2015 19:59 — forked from wilkerlucio/grid_builder.js
Photoshop Grid Generator
var DocumentArea = function(doc) {
this.doc = doc;
};
DocumentArea.prototype.bounds = function() {
return [0, 0, this.doc.width, this.doc.height];
};
var DocumentArea = function(doc) {
this.doc = doc;
@Arahnoid
Arahnoid / LayersToSpriteSheet.js
Created November 5, 2015 19:40 — forked from ChrisAntaki/LayersToSpriteSheet.js
Photoshop: Layers To Sprite Sheet
// Notes:
// 1. Save this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// 2. Run the script by going to menu File > Scripts > LayersToSpriteSheet
// Based on http://alessandroituarte.com/blag/2012/07/03/470
if (documents.length > 0) {
// Adjust this to the number of columns you want
// leave -1 if you want it to calculate an optimal column value.
@Arahnoid
Arahnoid / ps-export-layers-to-png.jsx
Last active April 21, 2019 23:20 — forked from tomekc/ps-export-layers-to-png.jsx
[Export .png layers] Photoshop script that exports to PNG all layers and groups whose names end with ".png". #Photoshop
#target photoshop
// $.level = 2;
/*
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
*
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.
@Arahnoid
Arahnoid / DrawShape.js
Created November 4, 2015 18:03 — forked from vladocar/DrawShape.js
Draw Shape in Photoshop with JavaScript
/* Code by Mike Hale http://www.ps-scripts.com/bb/viewtopic.php?f=14&t=1802&start=15
with small modification by Vladimir Carrer
*/
function DrawShape() {
var doc = app.activeDocument;
var y = arguments.length;
var i = 0;
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
var layerNum = app.activeDocument.layers.length;
prompt("Layers Number:", layerNum);
@Arahnoid
Arahnoid / layerNames.js
Last active April 21, 2019 22:47 — forked from vladocar/layerNames.js
[Get list of layer names] #Photoshop
var layerNum = app.activeDocument.layers.length;
var a = [];
for (var i = 0; i < layerNum; i++) {
a[i] = '"' + app.activeDocument.layers[i].name + '"';
}
prompt("Layers Names:", a);