Home · Register · Join Upload & Sell

Moderated by: Fred Miranda
Username  

  New fredmiranda.com Mobile Site
  New Feature: SMS Notification alert
  New Feature: Buy & Sell Watchlist
  

FM Forums | Post-processing & Printing | Join Upload & Sell

  

Archive 2014 · Photoshop Script Black and White Raster to Custom Vector Shape

  
 
Mr Mouse
Offline
• • •
Upload & Sell: Off
p.1 #1 · p.1 #1 · Photoshop Script Black and White Raster to Custom Vector Shape


Windows Photoshop Script Black and White Raster to Custom Vector Shape

I do not have AI Adobe for I do not want to spend the money and have to learn an other complex Adobe application. I'm no artist either. However at times I wanted to have AI live trace feature to change black and white line drawing into vector graphics. AI creates EPS files with embedded vectors. And can export the vector to Photoshop. Though Photoshop opens EPS as raster layers I find that EPS file created from tracing black and white lines and artwork with programs like potrace that use curves to create black vector shapes. That when these .eps files are opened in Photoshop as Black layer with transparency these layers transparency loaded as a selection and selection converted to path. I find the path are extremely good vector paths.

Potrace is a cross platform open source program packages available for many operating systems. Windows (32 bit) and (64 bit), Mac OS X (Intel), Mac OS X (universal),Linux (32 bit) and (64 bit), Linux (Alpha), Linux (Sparc64), Sun Solaris (Sparc), Sun Solaris (i386), Sun Solaris (x86_64), FreeBSD (i386), NetBSD (i386), OpenBSD (i386), AIX and AROS (i386). Potrace is a command line command. So it can be use started with options and passed a file from bat files and scripts. Potrace requires No instillation. All the required potrace files just need to be place into a folder and potrace run from that folder as the current directory.

So a created a Photoshop script that more or less uses potrace like a Photoshop Plug. The script define a custom shape for the current active document using potrace and add a new shape layer using the new defined custom shape as the top layer. The script also toggle off the other visible layers so you just see the shape layer. You can use alt click on the shape layer visibility icon to toggle the other layer visibility so you can see how well it matches the document.

I'm a windows user so the Photoshop script I wrote though in javascript will most likely only run on a windows platform because of my use of windows features its command line start command and file system conventions. I'm quite sure a Mac variant could created. Here is screen capture showing how well the defile custom shape matches up tot the current document and a link to the script.

You would need to download potrace to use the script and fix the two vars in the script that point to potrace. Find these two lines in the script and change them to reflect the location on your machine to where you have download potrace and extracted its files to.

var path="E:\\T5600 Downloads\\T5600 Applications\\potrace-1.11.win64\\";
var program="E:\\T5600 Downloads\\T5600 Applications\\potrace-1.11.win64\\potrace.exe";

Link to script, save its contents to a file named potrace.jsx and copy it to your Photoshop's folder \presets\scripts after you fix up the two var statements

http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-6918180-693870/900-380/Capture.jpg

http://forums.adobe.com/servlet/JiveServlet/showImage/2-6919127-694061/Clipboard1.jpg




Nov 11, 2014 at 11:37 AM





FM Forums | Post-processing & Printing | Join Upload & Sell

    
 

You are not logged in. Login or Register

Username       Or Reset password



This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.