用于脚本的Web服务器上的Photoshop [英] Photoshop on web server for scripts

查看:133
本文介绍了用于脚本的Web服务器上的Photoshop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在考虑解决我遇到的问题的最佳方法。

So, I'm trying to think of the best way to solve a problem I have.

问题是我为我的工作制作了很多网站CSS3和HTML5介绍自己强大我想要消除我的网站几乎所有图像。对于按钮图标和各种其他东西,我有一个带有所有图标的精灵图像,我只是根据我需要的图标移动。我需要做的是在Web服务器上动态地重新着色此图像,这样我就不必打开Photoshop并手动重新着色图标。

The problem is that I produce many websites for my job and as CSS3 and HTML5 introduce themselves powerful I want to eliminate almost all images from my websites. For button icons and various other things I have a sprite image with all the icons on that I just shift around depending what icon I need. What I need to be able to do is recolour this image dynamically on the web server so that I don't have to open up Photoshop and recolour the icons manually.

I已经做了一些研究,我遇到的唯一有机会以我想要的方式工作的是Photoshop JavaScript。我的问题是,一旦我编写了我的脚本并重新显示了我的图标图像,它是否可以在服务器上完成,因此,当用户点击按钮时,图像会重新着色并保存到服务器上?

I have done some research and the only thing that I've come across that has a chance of working the way I want it to is a Photoshop JavaScript. My question is, once I've written my script and it recolours my icon image, can it be done on a server so, when a user clicks a button for example, the image is recoloured and saved to the server?

这是否需要在服务器上安装Photoshop?这甚至可能吗?

Would this require installing Photoshop being installed on the server? Is this even possible?

推荐答案

这个问题多年来一直困扰着我...我总是希望有一个Photoshop服务器,我可以通过API谈话并完成工作..好吧..我已经构建了一些更接近...使用生成器插件我可以连接思想一个网络套接字并在Photoshop中注入javascript ..技术上你是能够使用 photoshop脚本指南完成任何工作。 ..(包括操纵现有的PDS)

Uhm this problem has been bothering me for years too.. all i always wished was to have a Photoshop Server which i could talk trough an API and get things done.. well.. i have built something that is Closer... using the generator plugin i can connect thought a web-socket and inject javascript in Photoshop.. technically you are able to do anything that can be done using photoshop scripting guide.... (Including manipulating existing PDS)

这个库 https://github.com/Milewski/generator-exporter 使用特殊语法导出所有标记的图层作为其所需的格式...
此代码可以在服务器上运行..使用nodejs

This library https://github.com/Milewski/generator-exporter exports all the marked layers with a special syntax as its desired format... this code could run on the server.. using nodejs

import { Generator } from 'generator-exporter'
import * as glob from 'glob'
import * as path from 'path'

const files = glob.sync(
    path.resolve(__dirname, '**/*.psd')
);

const generator = new Generator(files, {
    password: '123456',
    generatorOptions: {
        'base-directory': path.resolve(__dirname, 'output')
    }
})


generator.start()
         .then(() => console.log('Here You Could Grab all the generated images and send back to client....'));

但我不建议将此用于繁重的并发任务太多...因为它需要在本地安装photoshop ... Photoshop GUI将被初始化..这个过程非常慢。所以它并不适合繁忙的工作流程。

however i wouldn't recommend using this for heavy usage with too many concurrent tasks... because it needs photoshop installed locally... Photoshop GUI will be initialized.. this process is quite slow. so it doesn't really fit for a busy workflow.

这篇关于用于脚本的Web服务器上的Photoshop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆