{"id":1716,"date":"2011-03-10T13:31:07","date_gmt":"2011-03-10T04:31:07","guid":{"rendered":"https:\/\/regex.info\/blog\/photo-tech\/mat-builder"},"modified":"2011-03-10T23:26:24","modified_gmt":"2011-03-10T14:26:24","slug":"mat-builder","status":"publish","type":"page","link":"https:\/\/regex.info\/blog\/photo-tech\/mat-builder","title":{"rendered":"Jeffrey&#8217;s Fake-Mat-Building Photoshop Script"},"content":{"rendered":"\n\n<p>A few (low-resolution) examples...<\/p>\n\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example2_sm.jpg\" width=\"690\" height=\"488\"\nalt=\"an example of a photo with faux matting created with Jeffrey's Mat Builder photoshop script\"\nclass=\"raw\"\nid=\"imat_example2\"\/><\/div>\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1_sm.jpg\" width=\"690\" height=\"488\"\nalt=\"an example of a photo with faux matting created with Jeffrey's Mat Builder photoshop script\"\nclass=\"raw\"\nid=\"imat_example1\"\/><\/div>\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example5_sm.jpg\" width=\"690\" height=\"488\"\nalt=\"an example of a photo with faux matting created with Jeffrey's Mat Builder photoshop script\"\nclass=\"raw\"\nid=\"imat_example5\"\nstyle=\"border-color:#888\"\/><\/div>\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example6_sm.jpg\" width=\"690\" height=\"436\"\nalt=\"an example of a photo with faux matting created with Jeffrey's Mat Builder photoshop script\"\nclass=\"raw\"\nid=\"imat_example6\"\/><\/div>\n\n<p>So, I've been working on and off for a while on a Photoshop script that\nbuilds photo-realistic fake matting around images. The script is not done\nyet, but I'll present what I have in the hopes it's helpful to someone, and\nthat perhaps I can get some good feedback for improvements.<\/p>\n\n<p>Let me say up front that the process is a bit complex, somewhat out of\nnecessity because I want very good results, but also because I haven't done\nthe work to wrap the script up in a tidy hand-holding user interface.<\/p>\n\n<p style='margin: 50px 0 20px 0'><span style='color:#AAA; background-color:black; padding:10px 1em; border: solid 1px #800'>If\nyou're not comfortable editing a script file with a text editor, this post\nis not for you<\/span><\/p>\n\n<p>If you'd like something more automated, consider a commercial product,\nsuch as John Hartman's pricy ($239) but automated <a\nhref='http:\/\/www.jhartman.com\/quickmats.html'>Quick Mats<\/a>. I've not\ntried it, but the samples seem promising.<\/p>\n\n<p>Also up front: I've tested this on Photoshop CS5. I don't know whether it works on earlier versions.<\/p>\n\n<p>If you just want to play with a sample PSD created by this script, you can\ndownload this 28-megabyte <a href='\/i\/s\/sample-mat.zip'>sample-mat.zip<\/a>, which contains\none PSD: A4 size @ 250DPI with one opening at a 1&frac12;-inch margin, and John Hancock's signature.<\/p>\n\n<style type=\"text\/css\">\np.h1 { font-size: 145%; font-weight: bold; color: #FFA; margin-top:50px }\np.h2 { font-size: 115%; font-weight: bold; color: #FFA; margin-top:30px }\nimg.raw { border: solid 2px black; margin-bottom:8px }\nspan.ln { font-weight: bold; color: white }\ntd.fn   { font-family: Courier, \"Courier New\", monospace; font-size: 95%; color:#DDD }\nspan.fn { font-family: Courier, \"Courier New\", monospace; font-size: 95%; color:#DDD }\na.h1 { font-weight:bold; font-size: 110% }\n\ntable.code { font-family: Courier, 'Courier New', monospace; font-size: 95%; background-color: #A0A8A0; padding: 10px; margin-left:1em; color: black }\ntable.code td:first-child { text-align: right; background-color: #88C; padding: 0 3px; font-size: 80%}\ntable.code td:last-child  { padding: 0 8px }\ntable.code td { white-space: pre }\ntable.code span.key { color: #00A }\ntable.code span.c { color: #800; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif } \/\/ comment\ntable.code span.u { color: #088 } \/\/ undefined\ntable.code span.b { color: #080 } \/\/ Boolean\ntable.code a[href]:link    { color: #800  }\ntable.code a[href]:visited { color: #800  }\ntable.code a[href]:hover   { color: white }\ntable.code a:link          { color: #800  }\ntable.code a:visited       { color: #800  }\ntable.code a:hover         { color: white }\n\n<\/style>\n\n<p class='h2' style='margin-bottom:0'>Post table of contents:<\/p>\n<p style='margin-left:2em; margin-top:10px; line-height: 175%'>\n<a style='color:#C4B98F' class='h1' href='#features'>Features<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#pr'>Photo Realistic<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#color'>Easy to Adjust Mat Colors For a Specific Photo<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#custom'>Customizable<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#specific'>Specific<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#overlays'>Mat Overlays<\/a>\n<br\/>&nbsp;&nbsp;<a style='color:#C4B98F' class='h2' href='#limitations'>Current Limitations<\/a>\n<br\/><a style='color:#C4B98F' class='h1' href='#psd'>Mat's Photoshop Document<\/a>\n<br\/><a style='color:#C4B98F' class='h1' href='#files'>Installing The Script Files<\/a>\n<br\/><a style='color:#C4B98F' class='h1' href='#config'>Configuring The Script<\/a>\n<br\/><a style='color:#C4B98F' class='h1' href='#running'>Running The Script<\/a>\n<\/p>\n\n\n<p class='h1' id='features'>Features<\/p>\n\n<p>Let me start off outlining some of the features of the script....<\/p>\n\n<p class='h2' id='pr'>Photo Realistic<\/p>\n\n<p>That's the whole point... it's easy to make a <i>fake-looking<\/i> fake\nmat, but my script builds a result that incorporates many little visual\ncues to make a result that looks real when printed on a high-quality\nprinter and displayed on the wall, even when inspected fairly closely.<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1-c1.jpg\" width=\"644\" height=\"445\"\nalt=\"close-up detail of faux matting created with Jeffrey's Mat Builder photoshop script\"\nclass=\"raw\"\nid=\"imat_example1_c1\"\/>\n<br\/><b>Full-Resolution Crop<\/b><br\/>of an example to be printed at 250 DPI\n<div style='margin-top:5px'><small class='subtle-less'>( but on a computer screen, this is likely much larger than life size )<\/small><\/div>\n<\/div>\n\n\n<p style='margin-top:60px'>Perhaps most importantly, the surface of the mat\ncomes from an actual photograph of the surface of an actual mat, so when displayed\nat the proper resolution, it will be a true &#8220;actual size&#8221; representation of\nan actual physical mat.<\/p>\n\n<p><b style='color:#F88'>Note: as discussed below, the photos on this post are\nnecessarily displayed on your monitor at an incorrect resolution for accurate true-life sizing,\nso they'll all look less &#8220;natural&#8221; to an extent that depends on the specific monitor you're viewing this post on.<\/b>\n<span class='nobr'>I wish, of<\/span> course, that I could show them\nproperly on screen, but it's not technically feasible; however, in the end\nit doesn't really matter because these are intended to be <b>printed<\/b>,\nnot viewed on screen.<\/p>\n\n<p style='margin-bottom:40px'>Anyway, at the moment I have just four separate mat surfaces that have been\nprepared well enough to give a try at one resolution, but eventually I want\nto re-do them under higher-quality conditions. You can see the other\nsurfaces in the next examples...<\/p>\n\n<div class='ic' id='mat-example6-c1'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example6-c1.jpg\" width=\"644\" height=\"445\"\nclass=\"raw\"\nalt=\"close-up detail of faux matting created with Jeffrey's Mat Builder photoshop script\"\nid=\"imat_example6_c1\"\/>\n<br\/>two mats of different thicknesses and material\n<br\/>my pattern #2 is on top of the photo, pattern #3 is on top of that\n<\/div>\n\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1-c4.jpg\" width=\"644\" height=\"445\"\nclass=\"raw\"\nalt=\"close-up detail of faux matting created with Jeffrey's Mat Builder photoshop script\"\nid=\"imat_example1_c4\"\/>\n<br\/>this is pattern #1 again\n<\/div>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example2-c1.jpg\" width=\"644\" height=\"438\"\nclass=\"raw\"\nalt=\"close-up detail of faux matting created with Jeffrey's Mat Builder photoshop script\"\nid=\"imat_example2_c1\"\/>\n<br\/>pattern #4 laid over pattern #2\n<\/div>\n\n\n\n<p>A photo-realistic mat surface alone is a start, but it's not enough...\nother subtle visual cues the brain would expect in a physical mat are\nrequired. If done well, most people would hopefully not consciously notice\nthese visual cues, but I'll mention them here...<\/p>\n\n<p>For example, the edges where the mat is cut have a very slight\nraggedness that matches the surface of the mat. As for the cut surfaces\nthemselves (that is, the thin inside portion of the mat exposed when the\nopening is cut), their size, shape, and shading are all dependent on an\nintended eye location and light location configured when you build the mat.\nThe same intended light location also influences how a subtle shadow of the\nmat is cast onto the photo.<\/p>\n\n<p>The inside of the mat exposed at the edges of an opening is not perfectly\nsmooth, but slightly textured, as in real life. The thin edge in each\ncorner where two cuts meet has a slight shading that doesn't seem to make\nmuch sense to me in theory, but I see it in real mats, so I include it\nhere.<\/p>\n\n<p class='h2' id='color'>Easy to Adjust Mat Colors For a Specific Photo<\/p>\n\n<p>This'll be discussed more in the section about the Photoshop document\nthat the script produces, but the most important aesthetic decision of a mat\n&mdash; real or fake &mdash; is its color. In the final Photoshop document,\nyou use the normal Photoshop color picker to select the mat color, which\nmeans you can just drag an eye-dropper around an image to try colors,\nperhaps also adjusting saturation or brightness.<\/p>\n\n<p class='h2' id='custom'>Customizable<\/p>\n\n<p>The script allows you to adjust for the paper size and the specific\nnature of the printer and paper to be used, the number of mats, their\nthicknesses, their surface texture and color, the angle of the beveled\nknife cuts used to make each opening, and the size and location of however\nmany openings you want.<\/p>\n\n<p>Because this script is for something that will be printed and placed on\nthe wall, you can add important visual 3D cues to the mat cuts by\nincorporating the viewing location into the shape calculations. Because\nviewing such a result from the wrong position would look decidingly wonky,\nyou'd want to use this feature only if you know that the print will tend to\nbe viewed from a known general location. (For example, <a href='\/blog\/2011-02-16\/1706'>the\nprints hanging in my office<\/a> are normally seen while sitting in my\noffice chair.)<\/p>\n\n<p>Some things are customizable after the mat document has been generated,\nso that you can adjust them to suit the specific photo you're dropping in.\nMost important is the color of the mat, which you can pluck from the photo\nwith the eye dropper, but you can also control aspects of the lighting and\nshading, how pronounced or subtle the mat texture should be, etc.<\/p>\n\n<p class='h2' id='specific'>Specific<\/p>\n\n<p>The results of the script are intended to be printed on the specific\nprinter in the specific way the script is configured for. You can, of\ncourse, generate general-purpose mat documents, but you can eke out\nmore quality when being specific.<\/p>\n\n<div class='img_right' style='background-color:#333; border: 1px dotted #484848; margin: 0 0 15px 2em; text-align:center'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1-c1r.jpg\" width=\"330\" height=\"228\"\nclass=\"raw\"\nalt=\"close-up detail of faux matting created with Jeffrey's Mat Builder photoshop script\"\nid=\"imat_example1_c1r\"\/>\n<br\/>Example at 128 DPI\n<br\/>displays actual size on my laptop monitor<\/div>\n\n\n<p><b>Specific DPI<\/b><\/p>\n\n<p>The pattern on the surface of the mat is intended to be printed at a\nspecific DPI. If you print or display at a different resolution, it will\nend up being scaled in one way or the other (expanded or shrunk), after\nwhich it may no longer look real. For example, the mats in the sample\nphotos at the top of this post don't look particularly real: they've been\nshrunk down to &frac14; of their original pixel size to fit in this post,\nand then expanded by the fact that the originals were intended to be\ndisplayed at 250 DPI, but they're being viewed on your computer monitor\nwhich likely has a DPI somewhere in the 70-150 range.<\/p>\n\n<p>Since everyone's monitor setup is different, it's not possible to\ndisplay an &#8220;actual size&#8221; example on a blog post... the &#8220;250 DPI\nfull-resolution crop&#8221; above is likely quite larger than life, unless you're\nusing an iPhone retina display, in which case it, too, is smaller. For what\nit's worth, at left is a version appropriate for my own laptop.<\/p>\n\n<p><b>Specific Size<\/b><\/p>\n\n<p>Most printers can't print right up to the border of the paper, unless\nthey're put into a somewhat vague &#8220;borderless printing&#8221; mode that under the\nhood expands the image slightly to (hopefully) make sure the image goes well past\nthe edge of the paper, so as to not leave any bare paper exposed. You've\ngot no choice but to use this if you truly need to print to the edge of the\npaper, but if you don't need to (because, for example, the frame you intend\nto place the print in covers a smidgen of the edge of the paper), you can\navoid the uncertain fate of &#8220;borderless printing&#8221; by finding the\n&#8220;unprintable margin&#8221; specs for your printer and including them in the\nscript configuration. If you get it right, the exact pixels you need\n&mdash; no more and no less &mdash; will be generated for the print job,\navoiding all &#8220;resize to fit&#8221; shenanigans that would throw off all the\n&#8220;actual-size&#8221; measurements that went into the mat composition in the first\nplace.<\/p>\n\n<p><b>Specific Ink Coverage<\/b><\/p>\n\n<p>If you're not printing to the edge of the paper because part of the\npaper will be hidden by the frame, you may as well not waste the ink to\nprint anything that won't be seen, so you can configure that as well, to leave\nthe &#8220;hidden&#8221; parts of the mat unprinted. This is perhaps a bit overkill, but\nfor dark mats in thick frames, it could save quite a bit of ink.<\/p>\n\n<p>Here's an exaggerated example to illustrate these points, with particular details\nabout the left margin...<\/p>\n\n<div class='ic tight'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/MatLayout2.png\" width=\"727\" height=\"402\"\nclass=\"raw\"\nid=\"iMatLayout2\"\nstyle=\"border:none\"\/><\/div>\n\n<p>The result, if done correctly, is a slightly odd-looking mat image because printers &#8220;unprintable margins&#8221;\ntend to not be symmetrical. (Those of my Canon MP810, for example, are 3.388073mm on the sides, 4.98019mm on top,\nand 2.98741mm on bottom.) But once printed, the oddities match up perfectly, leaving an exactly-positioned result.<\/p>\n\n<p class='h2' id='overlays'>Mat Overlays<\/p>\n\n<p>I've made it easy to configure overlays onto the mat, such as\nsignatures, seals, and watermarks. Signing a print on the mat is a perfect\nexample. My signature looks like a child's, so I'll use John Hancock's\n(<a href='\/i\/s\/John%20Hancock%20Signature.psd'>this PSD<\/a>,\nderived from the version as\nseen <a href='http:\/\/en.wikipedia.org\/wiki\/John_Hancock'>on\nWikipedia<\/a>):<\/p>\n\n<div class='ic tight'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/John-Hancock-Signature.gif\" width=\"297\" height=\"88\"\nclass=\"raw\"\nid=\"iJohn_Hancock_Signature\"\/><\/div>\n\n<p>Here's what it can look like when automatically overlayed by the script:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1-c3.jpg\" width=\"644\" height=\"445\"\nclass=\"raw\"\nid=\"imat_example1_c3\"\/><\/div>\n\n\n<p>The script offers lots of customization on how the overlay is handled...\nthe example above attempts to mimic an old ink signature that's rubbed off\njust a bit over time from the high points on the mat. But just two clicks\nand you can get an embossed feel:<\/p>\n\n<div class='ic tight'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example1-c2.jpg\" width=\"644\" height=\"445\"\nclass=\"raw\"\nid=\"imat_example1_c2\"\/><\/div>\n\n<p>These controls respond to the specific mat stipple pattern, so again, everything is quite flexible.<\/p>\n\n<p>You can also overlay simple text...<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/mat-example6-c2.jpg\" width=\"644\" height=\"271\"\nclass=\"raw\"\nid=\"imat_example6_c2\"\/><br\/><b>Text Overlay<\/b>\n<br\/>( &#8220;Japanese Countryside&#8221; )<\/div>\n\n<p>...and again, you have a lot of control in the script what kind of processing you want to apply to the overlay,\nand, of course, once the Photoshop document has been built, you can then take over full manual control.<\/p>\n\n<p>You can arrange for the overlay to be cut along with the mat, as if it\nhad been part of a physical mat in the first place.<\/p>\n\n\n<p class='h2' id='limitations'>Current Limitations<\/p>\n\n<p>Some issues that remain to be improved...<\/p>\n\n<ol>\n<li><p><b>250 DPI<\/b> &mdash; So far I've prepared photo-realistic mat textures only at 250 DPI so far.\nIt's probably fine to use at 200 DPI or 300 DPI, but getting further from the original 250 DPI\nwill lead to a less natural look.<\/p><\/li>\n\n<li><p><b>Needs a UI<\/b> &mdash; It needs a dialog for mat configuration instead of requiring the user to edit a script.\nI just don't have the energy to build it now, though.<\/p><\/li>\n\n<li><p><b>More Customization<\/b> &mdash; Many more ways things can be customized in the script instead of being left to\nmanual manipulation in Photoshop itself. Overlay text items, for example, don't yet allow for customization of the font\nand such.<\/p><\/li>\n\n<li><p><b>Error Handling<\/b> &mdash; Not much work has been done in\ndetecting and reporting configuration errors... in the face of one, the\nscript will likely exit with some kind of meaningless message from the\nbowels of Photoshop.<\/p><\/li>\n\n\n<li><p><b>Non-ASCII Overlay Text<\/b> &mdash; I haven't figured out how to get non-ASCII text into overlays. (The example above\nwith Japanese text was created by configuring &#8220;TEST&#8221; in the script, then editing the text later in Photoshop.)<\/p><\/li>\n\n<\/ol>\n\n<p class='h1' id='psd'>Mat's Photoshop Document<\/p>\n\n<p>I'll get into how to configure and run the script later in this post,\nbut in this section I'll give an overview of the Photoshop document that\nthe script produces.<\/p>\n\n<p>What you get depends, of course, on how many mats and overlays and cuts\nand such, but the layerset illustrated below should give a good idea of\nwhat you can do between document generation and actual printing.<\/p>\n\n<p>Going from the bottom....<\/p>\n\n<img loading=\"lazy\" decoding=\"async\" src=\"\/i\/mat\/MatBuilderLayers.png\" width=\"313\" height=\"614\"\nclass=\"img_right raw\"\nid=\"iMatBuilderLayers\"\nstyle=\"margin:0 0 30px 2em; padding:0; border:none\"\/>\n\n<p><span class='ln'>Layer 1<\/span> is just a bright garish color so that\nit's easy to notice when you inadvertently leave some area of the document\nunfilled, such as when not fitting an image fully behind the mask\nproperly.<\/p>\n\n<p><span class='ln'>Layer 2<\/span> is where your photos goes. If you have\nmultiple photos, their layers get added to this spot.<\/p>\n\n<p><span class='ln'>Layers 3 - 17<\/span> are for the mat; in a document with more than one mat,\neach mat is represented by a similar group of layers.<\/p>\n\n<p><span class='ln'>Layer 3<\/span> is a non-visible layer used internally by the script.\nIt's not really needed once the script ends... a future version of the script will likely\ndelete the layer before finishing.<\/p>\n\n<p><span class='ln'>Layers 4 - 12<\/span> are for the thin strips of mat material made visible by the cuts used to create the opening.<\/p>\n\n<p><span class='ln'>Layer 4<\/span> is the texture for the inside material.<\/p>\n\n<p><span class='ln'>Layers 5 - 6<\/span> allow you to adjust the overall color and brightness of the cuts.<\/p>\n\n<p><span class='ln'>Layer 7<\/span> is a very subtle shading added to the edge in the corner where two cuts meet.<\/p>\n\n<p><span class='ln'>Layer 8 - 11<\/span> is the base shading applied to the cuts in response to the relative light position.<\/p>\n\n<p><span class='ln'>Layer 12<\/span> is an additional shadow of the mat that can, in some cases, fall onto the photo (or underlying mat) and cut edges.\nOften you can't even tell it's there, depending on the photo and how you've configured the lighting. You can see\n<a href=\"#mat-example6-c1\">an example above<\/a> in the \"<i>example with two mats of different thicknesses and material<\/i>\" crop, both in how\nthe shadow of the upper mat falls onto the lower mat, and in the lower mat, a very subtle shadow at the extreme right of the lower cut.<\/p>\n\n<p><span class='ln'>Layer 13<\/span> is the clipping layer that defines the front face of the mat.<\/p>\n\n<p><span class='ln'>Layer 14 is the color of the mat<\/span>. It's just a solid-color adjustment layer, so you can pluck a color\nfrom the photo with the eye-dropper tool.<\/p>\n\n<p><span class='ln'>Layer 15<\/span> is the mat texture layer. You can reduce its opacity to reduce the impact of the texture, if you feel the natural texture is too strong for your tastes.<\/p>\n\n<p><span class='ln'>Layer 16<\/span> is an additional mat brightness adjustment layer needed if you want particularly bright mats.\nThe Layer-14 color adjustment layer came from <a href='\/blog\/2011-02-04\/1702'>my post asking how to solve this colorization problem<\/a>,\nand Layer 14 alone works fine in many situations, but you can't get really bright or white mats with it, so in those cases you'll also have to visit this layer.<\/p>\n\n<p><span class='ln'>Layer 17<\/span> is where any overlay layers are added, in this case illustrated with the John Hancock signature overlay.\nFutzing with the layer effects for these layers can yield quite a difference in the look. Particularly fruitful are the Emboss effect,\nand enabling\/disabling the layer mask, which as been built to exclude where the underlying mat texture has highlights.<\/p>\n\n<p class='h1' id='files'>Installing The Mat Builder<\/p>\n\n<p>The mat builder is provided in two zips file, a small one with the main script files, and a large one with the texture patterns.<\/p>\n\n<div class='bg-A' style='margin-top:30px; padding: 10px 2em; width:70%'>\n<span class='bg-A' style='position:relative; top: -22px; background-color:#181818; padding: 3px 1em; font-weight: bold; color:white'>Main Script Files<\/span>\n<br\/>\nDownload:\n<div style='margin-left:2em'><a style='text-decoration:underline' href=\"\/i\/s\/Jeffrey%27s%20Mat%20Builder-v2.zip\"><b>Jeffrey's Mat Builder-v2.zip<\/b><\/a><\/div>\n<br\/>\nContents:\n\n   <table style='margin-left:2em' border='0' cellspacing='0' cellpadding='10'>\n   <tr valign='baseline'><td><i>type<\/i><br\/><hr\/>script file\n   <br\/>script file\n   <br\/>script file<\/td><td><i>filename<\/i><br\/><hr\/><span class='fn'>\n   Jeffrey's Mat Builder.jsx\n   <br\/>Jeffrey's Mat Builder Library.jsxinc\n   <br\/>Jeffrey's Photoshop Script Library.jsxinc<\/span>\n   <\/td><\/tr>\n   <\/table>\n\n<\/div>\n\n\n<div class='bg-B' style='margin-top:40px; padding: 10px 2em; width:70%'>\n<span class='bg-B' style='position:relative; top: -22px; background-color:#181818; padding: 3px 1em; font-weight: bold; color:white'>Pattern Data<\/span>\n<br\/>\nDownload:\n<div style='margin-left:2em'><a style='text-decoration:underline' href=\"\/i\/s\/Jeffrey%27s%20Mat%20Builder%20Patterns-v20110310.zip\"><b>Jeffrey's Mat Builder Patterns-v20110310.zip<\/b><\/a><\/div>\n<br\/>\nContents:\n\n   <table style='margin-left:2em' border='0' cellspacing='0' cellpadding='10'>\n   <tr valign='baseline'><td><i>type<\/i><br\/><hr\/>script file\n   <br\/>pattern preset<\/td><td><i>filename<\/i><br\/><hr\/><span class='fn'>\n   Jeffrey's Mat Pattern Data.jsxinc\n   <br\/>Jeffrey's Mat Patterns.pat<\/span><\/td><\/tr>\n   <\/table>\n\n<\/div>\n\n\n<p style='margin-top:40px'>After downloading and unpacking both zip files, you can install:<\/p>\n\n<ol><li><p>Clicking on <span class='fn'>Jeffrey's Mat Patterns.pat<\/span> (from the second zip) in Finder\/Explorer should launch Photoshop and install the pattern presets.\nYou'll not see anything happen once Photoshop is open, but if you look in\n\n  <span class='nobr'>\"<span class='fn'>Edit &gt; Presets Manager &gt; Patterns<\/span>\"<\/span>\n\nyou should find four &#8220;Jeffrey's Mat Pattern&#8221; patterns.<\/p><\/li>\n\n<li><p>The other files (<span class='fn'>*.jsx<\/span> and <span class='fn'>*.jsxinc<\/span> from both zips) must be copied to the\n<span class='fn'>Scripts<\/span> folder in your Photoshop install. Your install may differ,\nbut the common locations are:<\/p>\n\n<table style='margin-left:20px' border='1' cellspacing='0' cellpadding='10'>\n<tr><td>Mac<\/td><td class='fn'>\/Applications\/Adobe Photoshop CS5\/Presets\/Scripts\/<\/td><\/tr>\n<tr><td>Windows<\/td><td class='fn'>C:\\Program Files\\Adobe\\Adobe Photoshop CS5\\Presets\/Scripts\\<\/td><\/tr>\n<\/table>\n\n<p>Once the files are copied and Photoshop is restarted,\n\n  <span class='nobr'>&#8220;<span class='fn'>File &gt; Scripts<\/span>&#8221;<\/span>\n\nshould then contain a new item,\n\n  <span class='nobr'>&#8220;<span class='fn'>Jeffrey's Mat Builder<\/span>&#8221;<\/span>.\n\n<\/p>\n\n<p>But, don't run it yet... you'll want to make changes for your specific needs first, which is what\nthe next section is about.<\/p>\n<\/li>\n\n<\/ol>\n\n<p>Updates are done in the same way, though you need install only the new\nfiles when updating from only one of the zips. (I don't expect the pattern\ndata to be updated all that often.)<\/p>\n\n<p class='h1' id='config'>Configuring The Script<\/p>\n\n<p>This kind of application begs for a nice UI that allows you to easily\nconfigure settings and save\/invoke presets, but for now you've got to edit\nthe raw file.<\/p>\n\n<p>Before showing a full-on configuration file with all options\nillustrated, let me show a minimal one that creates a simple A4-sized image\nof one mat with a 1.75-inch margin around a central opening:<\/p>\n\n\n<table class='code' cellpadding='3' cellspacing='0'>\n<tr><td>1<\/td><td>#target photoshop<\/td><\/tr>\n<tr><td>2<\/td><td>#script \"Jeffrey's Mat Builder\" <span class='c'>\/\/ name to appear in the \"File &gt; Scripts\" menu<\/span><\/td><\/tr>\n<tr><td>3<\/td><td>#include \"Jeffrey's Mat Builder Library.jsxinc\" <span class='c'>\/\/ defines \"JMB\" object used below<\/span><\/td><\/tr>\n<tr><td>4<\/td><td>JMB.requireVersionAtLeast(1)<\/td><\/tr>\n<tr><td>5<\/td><td><\/td><\/tr>\n<tr><td>6<\/td><td>var simple = {<\/td><\/tr>\n<tr><td>7<\/td><td>    <span class='key'>paper<\/span>: \"A4\",<\/td><\/tr>\n<tr><td>8<\/td><td>    <span class='key'>DPI<\/span>  : 250,<\/td><\/tr>\n<tr><td>9<\/td><td>    <span class='key'>mats<\/span> : [{<\/td><\/tr>\n<tr><td>10<\/td><td>        <span class='key'>pattern_tag<\/span> : \"JeffreysMatPattern2\",<\/td><\/tr>\n<tr><td>11<\/td><td>        <span class='key'>ragged_edge<\/span> : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>12<\/td><td>        <span class='key'>cuts<\/span>        : [{<\/td><\/tr>\n<tr><td>13<\/td><td>            <span class='key'>margin<\/span> : UnitValue(1.75, \"in\"),<\/td><\/tr>\n<tr><td>14<\/td><td>            <span class='key'>fill_with_doc_at_open<\/span> : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>15<\/td><td>        }],<\/td><\/tr>\n<tr><td>16<\/td><td>    }]<\/td><\/tr>\n<tr><td>17<\/td><td>}<\/td><\/tr>\n<tr><td>18<\/td><td><\/td><\/tr>\n<tr><td>19<\/td><td>JMB.build(simple)<\/td><\/tr>\n<\/table>\n\n\n<p>The configuration itself is on lines 6 through 17, which is then used on\nline 19 when invoking the builder. The paper size and DPI must be specified\nin every configuration, as must the mats. In this case, there's one mat\nusing my pattern #2, and it has one cut.<\/p>\n\n<p>It's set up such that if it's invoked while there's already a document\nactive in Photoshop and that document has only one layer, a copy will be\ninserted behind the mat in the newly-created document. This allows you to\n&#8220;invoke the script on a photo&#8221;, so to speak. But you can always drop photos\nin after building the document, as well.<\/p>\n\n<p style='margin-top:40px'>Here's the version included in the script-files\ndownload. It's its own documentation for how to use it... it's got lots of\ncomments, doesn't rely on default values, and includes all settings,\nincluding ones that aren't used, just to illustrate that they exist.<\/p>\n\n<table class='code' cellpadding='3' cellspacing='0'>\n<tr><td>1<\/td><td>#target photoshop<\/td><\/tr>\n<tr><td>2<\/td><td><\/td><\/tr>\n<tr><td>3<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>4<\/td><td><span class='c'>\/\/  Jeffrey's Mat Builder Photoshop Script<\/span><\/td><\/tr>\n<tr><td>5<\/td><td><span class='c'>\/\/  Creates photo-realistic fake (faux) matting for (almost-)fine art prints<\/span><\/td><\/tr>\n<tr><td>6<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>7<\/td><td><span class='c'>\/\/  <a href='\/blog\/photo-tech\/mat-builder'>https:\/\/regex.info\/blog\/photo-tech\/mat-builder<\/a><\/span><\/td><\/tr>\n<tr><td>8<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>9<\/td><td><span class='c'>\/\/  Copyright 2011 Jeffrey Friedl<\/span><\/td><\/tr>\n<tr><td>10<\/td><td><span class='c'>\/\/  <a href='\/blog\/'>https:\/\/regex.info\/blog\/<\/a><\/span><\/td><\/tr>\n<tr><td>11<\/td><td><span class='c'>\/\/  jfriedl@yahoo.com<\/span><\/td><\/tr>\n<tr><td>12<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>13<\/td><td><\/td><\/tr>\n<tr><td>14<\/td><td>var VERSION=1 <span class='c'>\/\/ March 10, 2011<\/span><\/td><\/tr>\n<tr><td>15<\/td><td><\/td><\/tr>\n<tr><td>16<\/td><td>#include \"Jeffrey's Mat Builder Library.jsxinc\" <span class='c'>\/\/ defines \"JMB\" object<\/span><\/td><\/tr>\n<tr><td>17<\/td><td>JMB.requireVersionAtLeast(1)<\/td><\/tr>\n<tr><td>18<\/td><td><\/td><\/tr>\n<tr><td>19<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>20<\/td><td><span class='c'>\/\/ All the items below with a value of \"undefined\" may be omitted.<\/span><\/td><\/tr>\n<tr><td>21<\/td><td><span class='c'>\/\/ I've listed them here merely as documentation of what options are supported.<\/span><\/td><\/tr>\n<tr><td>22<\/td><td><span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>23<\/td><td>JMB.build({<\/td><\/tr>\n<tr><td>24<\/td><td>    <span class='c'>\/\/ Size and orientation of the canvas.<\/span><\/td><\/tr>\n<tr><td>25<\/td><td>    <span class='key'>paper<\/span>     : \"A4\",<\/td><\/tr>\n<tr><td>26<\/td><td><\/td><\/tr>\n<tr><td>27<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>28<\/td><td>    <span class='c'>\/\/ There's a list of known paper sizes in \"Jeffrey's Photoshop Script Library.jsxinc\"<\/span><\/td><\/tr>\n<tr><td>29<\/td><td>    <span class='c'>\/\/ that you can can set 'paper' to, or you can set the size explicitly with:<\/span><\/td><\/tr>\n<tr><td>30<\/td><td>    <span class='c'>\/\/    width  : UnitValue(\"210 mm\"),<\/span><\/td><\/tr>\n<tr><td>31<\/td><td>    <span class='c'>\/\/    height : UnitValue(\"297 mm\"),<\/span><\/td><\/tr>\n<tr><td>32<\/td><td>    <span class='c'>\/\/ The paper size is always give for the paper in the Portrait orientation it's put<\/span><\/td><\/tr>\n<tr><td>33<\/td><td>    <span class='c'>\/\/ into the printer as.<\/span><\/td><\/tr>\n<tr><td>34<\/td><td><\/td><\/tr>\n<tr><td>35<\/td><td>    <span class='key'>DPI<\/span>       : 250, <span class='c'>\/\/ Pixels per inch. Pick what you intend to print at.<\/span><\/td><\/tr>\n<tr><td>36<\/td><td><\/td><\/tr>\n<tr><td>37<\/td><td>    <span class='c'>\/\/ Can be true, false, or \"ask\"<\/span><\/td><\/tr>\n<tr><td>38<\/td><td>    <span class='key'>landscape<\/span> : \"ask\",<\/td><\/tr>\n<tr><td>39<\/td><td><\/td><\/tr>\n<tr><td>40<\/td><td>    <span class='c'>\/\/ Once mounted and hung on the wall, where is the primary viewing location?<\/span><\/td><\/tr>\n<tr><td>41<\/td><td>    <span class='key'>eye_from_wall<\/span>         : UnitValue(2.0, \"m\"),<\/td><\/tr>\n<tr><td>42<\/td><td>    <span class='key'>eye_below_center<\/span>      : UnitValue(0,   \"m\"),<\/td><\/tr>\n<tr><td>43<\/td><td>    <span class='key'>eye_right_of_center<\/span>   : UnitValue(0,  \"in\"),<\/td><\/tr>\n<tr><td>44<\/td><td><\/td><\/tr>\n<tr><td>45<\/td><td>    <span class='c'>\/\/ main lighting source (for shadows)<\/span><\/td><\/tr>\n<tr><td>46<\/td><td>    <span class='key'>light_oclock<\/span>          : 3,<\/td><\/tr>\n<tr><td>47<\/td><td>    <span class='key'>light_distance<\/span>        : UnitValue(2,    \"m\"),<\/td><\/tr>\n<tr><td>48<\/td><td>    <span class='key'>light_in_front<\/span>        : UnitValue(1.5,  \"m\"),<\/td><\/tr>\n<tr><td>49<\/td><td><\/td><\/tr>\n<tr><td>50<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>51<\/td><td>    <span class='c'>\/\/ If you're intending to put the print into a frame that covers the edge of the paper, you can<\/span><\/td><\/tr>\n<tr><td>52<\/td><td>    <span class='c'>\/\/ avoid the ink wasted on print that won't be seen by setting some margins here. Make sure to<\/span><\/td><\/tr>\n<tr><td>53<\/td><td>    <span class='c'>\/\/ use distances a bit smaller to allow some leeway.<\/span><\/td><\/tr>\n<tr><td>54<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>55<\/td><td>    <span class='key'>hidden_by_frame<\/span> : {<\/td><\/tr>\n<tr><td>56<\/td><td>        <span class='key'>left<\/span>   : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>57<\/td><td>        <span class='key'>right<\/span>  : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>58<\/td><td>        <span class='key'>top<\/span>    : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>59<\/td><td>        <span class='key'>bottom<\/span> : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>60<\/td><td>    },<\/td><\/tr>\n<tr><td>61<\/td><td><\/td><\/tr>\n<tr><td>62<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>63<\/td><td>    <span class='c'>\/\/ If not printing in a specific \"borderless\" mode, most printers have some edge of the paper<\/span><\/td><\/tr>\n<tr><td>64<\/td><td>    <span class='c'>\/\/ that can't be printed; if you'll be printing in such a mode, set these values as per the<\/span><\/td><\/tr>\n<tr><td>65<\/td><td>    <span class='c'>\/\/ printer specs.<\/span><\/td><\/tr>\n<tr><td>66<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>67<\/td><td>    <span class='key'>unprintable_margin<\/span>: {<\/td><\/tr>\n<tr><td>68<\/td><td>        <span class='key'>top<\/span>    : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>69<\/td><td>        <span class='key'>bottom<\/span> : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>70<\/td><td>        <span class='key'>left<\/span>   : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>71<\/td><td>        <span class='key'>right<\/span>  : UnitValue(0, \"mm\"),<\/td><\/tr>\n<tr><td>72<\/td><td>    },<\/td><\/tr>\n<tr><td>73<\/td><td><\/td><\/tr>\n<tr><td>74<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>75<\/td><td>    <span class='c'>\/\/ Array of mats to be created. You can have any number of mats, and any number of openings in<\/span><\/td><\/tr>\n<tr><td>76<\/td><td>    <span class='c'>\/\/ each mat. Traditionally, there's one opening in one or two mats, but you can make grids of<\/span><\/td><\/tr>\n<tr><td>77<\/td><td>    <span class='c'>\/\/ openings, go crazy with 10 mats, etc.<\/span><\/td><\/tr>\n<tr><td>78<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>79<\/td><td>    <span class='c'>\/\/ Earlier mats are laid down first, so in a multiple-mat situation, the first mat listed be<\/span><\/td><\/tr>\n<tr><td>80<\/td><td>    <span class='c'>\/\/ the smallest opening with the image behind it, while subsequent mat would have progressively<\/span><\/td><\/tr>\n<tr><td>81<\/td><td>    <span class='c'>\/\/ larger openings. If specifying the opening via margin from the edge, you'd want progressively<\/span><\/td><\/tr>\n<tr><td>82<\/td><td>    <span class='c'>\/\/ smaller margins as you go.<\/span><\/td><\/tr>\n<tr><td>83<\/td><td>    <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>84<\/td><td>    <span class='key'>mats<\/span> : [{<\/td><\/tr>\n<tr><td>85<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>86<\/td><td>        <span class='c'>\/\/ If you have a specific color you'd like you use for the mat, you can along the lines of<\/span><\/td><\/tr>\n<tr><td>87<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>88<\/td><td>        <span class='c'>\/\/    color : JPSL.RGB(100,0,0), \/\/ pure red<\/span><\/td><\/tr>\n<tr><td>89<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>90<\/td><td>        <span class='c'>\/\/ but if you leave the color undefined, the foreground color will be used.<\/span><\/td><\/tr>\n<tr><td>91<\/td><td>        <span class='c'>\/\/ It doesn't really matter much, because in either case it's trivial to change the color<\/span><\/td><\/tr>\n<tr><td>92<\/td><td>        <span class='c'>\/\/ with the eye-dropper tool once the document is built.<\/span><\/td><\/tr>\n<tr><td>93<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>94<\/td><td>        <span class='key'>color<\/span>       : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>95<\/td><td><\/td><\/tr>\n<tr><td>96<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>97<\/td><td>        <span class='c'>\/\/ The color of the inside of the mat, exposed when the opening is cut. If not provided,<\/span><\/td><\/tr>\n<tr><td>98<\/td><td>        <span class='c'>\/\/ the 80% white shown below is used, since the inside of most mats is indeed whiteish.<\/span><\/td><\/tr>\n<tr><td>99<\/td><td>        <span class='c'>\/\/ You can also use the string \"same as mat\" for the same color as the mat.<\/span><\/td><\/tr>\n<tr><td>100<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>101<\/td><td>        <span class='key'>cut_color<\/span>   : JPSL.RGB(80,80,80),<\/td><\/tr>\n<tr><td>102<\/td><td><\/td><\/tr>\n<tr><td>103<\/td><td><\/td><\/tr>\n<tr><td>104<\/td><td>        <span class='c'>\/\/ Mats default to a 1mm thickness, but you can adjust that here.<\/span><\/td><\/tr>\n<tr><td>105<\/td><td>        <span class='key'>thickness<\/span>   : UnitValue(1, \"mm\"),<\/td><\/tr>\n<tr><td>106<\/td><td><\/td><\/tr>\n<tr><td>107<\/td><td>        <span class='c'>\/\/ The angle of each beveled cut into the mat. Default is 45.<\/span><\/td><\/tr>\n<tr><td>108<\/td><td>        <span class='c'>\/\/ 70 is steep and creates a thin result; 90 is punch-out thin.<\/span><\/td><\/tr>\n<tr><td>109<\/td><td>        <span class='key'>cut_angle<\/span>   : 45,<\/td><\/tr>\n<tr><td>110<\/td><td><\/td><\/tr>\n<tr><td>111<\/td><td>        <span class='c'>\/\/ The pattern to use for the mat surface texture. Currently, you can choose from among:<\/span><\/td><\/tr>\n<tr><td>112<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>113<\/td><td>        <span class='c'>\/\/     JeffreysMatPattern1<\/span><\/td><\/tr>\n<tr><td>114<\/td><td>        <span class='c'>\/\/     JeffreysMatPattern2<\/span><\/td><\/tr>\n<tr><td>115<\/td><td>        <span class='c'>\/\/     JeffreysMatPattern3<\/span><\/td><\/tr>\n<tr><td>116<\/td><td>        <span class='c'>\/\/     JeffreysMatPattern4<\/span><\/td><\/tr>\n<tr><td>117<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>118<\/td><td>        <span class='key'>pattern_tag<\/span> : \"JeffreysMatPattern1\",<\/td><\/tr>\n<tr><td>119<\/td><td><\/td><\/tr>\n<tr><td>120<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>121<\/td><td>        <span class='c'>\/\/ If 'ragged_edge' is true, attempt to rough up the edge of any cuts slightly, as<\/span><\/td><\/tr>\n<tr><td>122<\/td><td>        <span class='c'>\/\/ appropriate to the mat's stippling pattern, to make the cut look less fake.<\/span><\/td><\/tr>\n<tr><td>123<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>124<\/td><td>        <span class='key'>ragged_edge<\/span> : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>125<\/td><td><\/td><\/tr>\n<tr><td>126<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>127<\/td><td>        <span class='c'>\/\/ A mat can have any number of cuts to make openings (behind which you'll presumably place<\/span><\/td><\/tr>\n<tr><td>128<\/td><td>        <span class='c'>\/\/ photos). Optionally, you can specify the image to be placed behind (and fitted to) the cut.<\/span><\/td><\/tr>\n<tr><td>129<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>130<\/td><td>        <span class='c'>\/\/ There are many ways to specify the size and location of the cut.... the first one<\/span><\/td><\/tr>\n<tr><td>131<\/td><td>        <span class='c'>\/\/ found is used (they're listed below in the order they're checked).<\/span><\/td><\/tr>\n<tr><td>132<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>133<\/td><td>        <span class='c'>\/\/ All values for cut location and size are UnitValues(), e.g.<\/span><\/td><\/tr>\n<tr><td>134<\/td><td>        <span class='c'>\/\/   margin: UnitValue(\"3 mm\")<\/span><\/td><\/tr>\n<tr><td>135<\/td><td>        <span class='c'>\/\/ or<\/span><\/td><\/tr>\n<tr><td>136<\/td><td>        <span class='c'>\/\/   margin: UnitValue(3, \"mm\")<\/span><\/td><\/tr>\n<tr><td>137<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>138<\/td><td>        <span class='key'>cuts<\/span> : [{<\/td><\/tr>\n<tr><td>139<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>140<\/td><td>            <span class='c'>\/\/ Two ways to pre-load a photo behind the cut you're about to make...<\/span><\/td><\/tr>\n<tr><td>141<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>142<\/td><td>            <span class='c'>\/\/ One is to have the script automatically place the document that's active at the time<\/span><\/td><\/tr>\n<tr><td>143<\/td><td>            <span class='c'>\/\/ you invoke this script, so that you can effectively \"apply\" this script to document.<\/span><\/td><\/tr>\n<tr><td>144<\/td><td>            <span class='c'>\/\/ This works only if said document is exactly one layer; the directive is ignored if<\/span><\/td><\/tr>\n<tr><td>145<\/td><td>            <span class='c'>\/\/ otherwise.   If you use this option, you probably want to set 'landscape' above to<\/span><\/td><\/tr>\n<tr><td>146<\/td><td>            <span class='c'>\/\/ the string \"ask\".<\/span><\/td><\/tr>\n<tr><td>147<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>148<\/td><td>            <span class='c'>\/\/ The other way is to provide the location of an image file, via \"fill_with\"<\/span><\/td><\/tr>\n<tr><td>149<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>150<\/td><td>            <span class='c'>\/\/ You don't need to provide a photo for the opening, but if you want do, choose one of:<\/span><\/td><\/tr>\n<tr><td>151<\/td><td>            <span class='key'>fill_with_doc_at_open<\/span> : <span class='b'>true<\/span>, <span class='c'>\/\/ true or false. If true, fill_with is ignored<\/span><\/td><\/tr>\n<tr><td>152<\/td><td>            <span class='key'>fill_with<\/span>             : <span class='u'>undefined<\/span>, <span class='c'>\/\/ put the full path to an image, in quotes<\/span><\/td><\/tr>\n<tr><td>153<\/td><td><\/td><\/tr>\n<tr><td>154<\/td><td><\/td><\/tr>\n<tr><td>155<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>156<\/td><td>            <span class='c'>\/\/ If you don't provide a photo to fill the opening, it's left blank and you can drop or<\/span><\/td><\/tr>\n<tr><td>157<\/td><td>            <span class='c'>\/\/ paste or place (File &gt; Place) a photo in later.<\/span><\/td><\/tr>\n<tr><td>158<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>159<\/td><td>            <span class='c'>\/\/ *If* you provide an image via either of the two methods above, you can specify the<\/span><\/td><\/tr>\n<tr><td>160<\/td><td>            <span class='c'>\/\/ size via a minimum margin from the mat edge. This results in the cut being made to<\/span><\/td><\/tr>\n<tr><td>161<\/td><td>            <span class='c'>\/\/ the exact proportions of the photo, so it's shown completely.<\/span><\/td><\/tr>\n<tr><td>162<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>163<\/td><td>            <span class='c'>\/\/ (If 'min_margin' is not specified, the cut proportions are unrelated to the photo,<\/span><\/td><\/tr>\n<tr><td>164<\/td><td>            <span class='c'>\/\/  so the photo will be expanded to fill the opening as well as possible.)<\/span><\/td><\/tr>\n<tr><td>165<\/td><td>            <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>166<\/td><td>            <span class='key'>min_margin<\/span>: <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>167<\/td><td><\/td><\/tr>\n<tr><td>168<\/td><td>            <span class='c'>\/\/ or, the cut can be specified as a constant margin from the edge of the mat<\/span><\/td><\/tr>\n<tr><td>169<\/td><td>            <span class='key'>margin<\/span> : UnitValue(1.5, \"in\"),<\/td><\/tr>\n<tr><td>170<\/td><td><\/td><\/tr>\n<tr><td>171<\/td><td>            <span class='c'>\/\/ or, the cut can be specified as top\/bottom and left\/right margins<\/span><\/td><\/tr>\n<tr><td>172<\/td><td>            <span class='key'>margin_leftright<\/span>: <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>173<\/td><td>            <span class='key'>margin_topbottom<\/span>: <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>174<\/td><td><\/td><\/tr>\n<tr><td>175<\/td><td>            <span class='c'>\/\/ or, the cut can be specified with margins on all sides<\/span><\/td><\/tr>\n<tr><td>176<\/td><td>            <span class='key'>margin_left<\/span>   : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>177<\/td><td>            <span class='key'>margin_right<\/span>  : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>178<\/td><td>            <span class='key'>margin_top<\/span>    : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>179<\/td><td>            <span class='key'>margin_bottom<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>180<\/td><td><\/td><\/tr>\n<tr><td>181<\/td><td>            <span class='c'>\/\/ or, the cut can be specified with absolute upper-right \/ lower-left coordinates,<\/span><\/td><\/tr>\n<tr><td>182<\/td><td>            <span class='c'>\/\/ provided via a 'loc' object that contains x1\/y1\/x2\/y2 UnitValue members.<\/span><\/td><\/tr>\n<tr><td>183<\/td><td>            <span class='key'>loc<\/span>: <span class='u'>undefined<\/span>, <span class='c'>\/\/ { x1:UnitValue(...),y1:UnitValue(...), .... }<\/span><\/td><\/tr>\n<tr><td>184<\/td><td><\/td><\/tr>\n<tr><td>185<\/td><td>            <span class='c'>\/\/ or the four coordinates provided directly<\/span><\/td><\/tr>\n<tr><td>186<\/td><td>            <span class='key'>x1<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>187<\/td><td>            <span class='key'>y1<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>188<\/td><td>            <span class='key'>x2<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>189<\/td><td>            <span class='key'>y2<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>190<\/td><td><\/td><\/tr>\n<tr><td>191<\/td><td>            <span class='c'>\/\/ or, the cut can be specified with the x\/y coordinate of the upper-right,<\/span><\/td><\/tr>\n<tr><td>192<\/td><td>            <span class='c'>\/\/ and a width and height.<\/span><\/td><\/tr>\n<tr><td>193<\/td><td>            <span class='key'>x<\/span>      : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>194<\/td><td>            <span class='key'>y<\/span>      : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>195<\/td><td>            <span class='key'>width<\/span>  : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>196<\/td><td>            <span class='key'>height<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>197<\/td><td><\/td><\/tr>\n<tr><td>198<\/td><td>            <span class='c'>\/\/ an 'omit' of true causes this cut to be skipped; perhaps useful while testing<\/span><\/td><\/tr>\n<tr><td>199<\/td><td>            <span class='key'>omit<\/span>   : <span class='b'>false<\/span>,<\/td><\/tr>\n<tr><td>200<\/td><td><\/td><\/tr>\n<tr><td>201<\/td><td>            <span class='c'>\/\/ you can have as many cuts as you want, in separate arrays after his one<\/span><\/td><\/tr>\n<tr><td>202<\/td><td>        }],<\/td><\/tr>\n<tr><td>203<\/td><td><\/td><\/tr>\n<tr><td>204<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>205<\/td><td>        <span class='c'>\/\/ An overlay is a separate image or text layer placed on the mat, such as<\/span><\/td><\/tr>\n<tr><td>206<\/td><td>        <span class='c'>\/\/ an embossed seal, signature, or image title.<\/span><\/td><\/tr>\n<tr><td>207<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>208<\/td><td>        <span class='c'>\/\/ If you've got an overlay defined but want to try without it (such as to<\/span><\/td><\/tr>\n<tr><td>209<\/td><td>        <span class='c'>\/\/ speed up testing other aspects of the script), use<\/span><\/td><\/tr>\n<tr><td>210<\/td><td>        <span class='c'>\/\/       omit: true,<\/span><\/td><\/tr>\n<tr><td>211<\/td><td>        <span class='c'>\/\/<\/span><\/td><\/tr>\n<tr><td>212<\/td><td>        <span class='key'>overlays<\/span> :[{<\/td><\/tr>\n<tr><td>213<\/td><td>            <span class='key'>omit<\/span> : <span class='b'>false<\/span>,<\/td><\/tr>\n<tr><td>214<\/td><td><\/td><\/tr>\n<tr><td>215<\/td><td>            <span class='c'>\/\/ An overlay can be an image file -or- a text string (via \"file\" or \"text\"):<\/span><\/td><\/tr>\n<tr><td>216<\/td><td>            <span class='key'>file<\/span> : \"~\/Documents\/John Hancock Signature.psd\",<\/td><\/tr>\n<tr><td>217<\/td><td>            <span class='key'>text<\/span> : <span class='u'>undefined<\/span>, <span class='c'>\/\/ e.g.   text: \"My Super Pics\"<\/span><\/td><\/tr>\n<tr><td>218<\/td><td>            <span class='c'>\/\/ If you'd like to try the John Hancock signature yourself, you can grab<\/span><\/td><\/tr>\n<tr><td>219<\/td><td>            <span class='c'>\/\/ it from:   <a href='\/i\/s\/John Hancock Signature.psd'>http:\/\/regex.info\/i\/s\/John Hancock Signature.psd<\/a><\/span><\/td><\/tr>\n<tr><td>220<\/td><td><\/td><\/tr>\n<tr><td>221<\/td><td><\/td><\/tr>\n<tr><td>222<\/td><td>            <span class='c'>\/\/ If you want to scale the overlay, provide a width, a height, or both<\/span><\/td><\/tr>\n<tr><td>223<\/td><td>            <span class='key'>height<\/span> : UnitValue(\"0.65 in\"),<\/td><\/tr>\n<tr><td>224<\/td><td>            <span class='key'>width<\/span>  : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>225<\/td><td><\/td><\/tr>\n<tr><td>226<\/td><td>            <span class='c'>\/\/ To specify where on the mat the overlay should be placed,<\/span><\/td><\/tr>\n<tr><td>227<\/td><td>            <span class='c'>\/\/ set the vertical location of the top or bottom edge, or of the middle, and<\/span><\/td><\/tr>\n<tr><td>228<\/td><td>            <span class='c'>\/\/ set the horizontal location of the left or right edge, or of the center.<\/span><\/td><\/tr>\n<tr><td>229<\/td><td>            <span class='key'>top<\/span>    : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>230<\/td><td>            <span class='key'>middle<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>231<\/td><td>            <span class='key'>bottom<\/span> : UnitValue(\"0.35 in\"), <span class='c'>\/\/ cut.b2 + UnitValue(\"2mm\"),<\/span><\/td><\/tr>\n<tr><td>232<\/td><td><\/td><\/tr>\n<tr><td>233<\/td><td>            <span class='key'>left<\/span>   : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>234<\/td><td>            <span class='key'>center<\/span> : <span class='u'>undefined<\/span>,<\/td><\/tr>\n<tr><td>235<\/td><td>            <span class='key'>right<\/span>  : UnitValue(\"1.0 in\"), <span class='c'>\/\/ cut.x2 - UnitValue(\"0.5 in\"),<\/span><\/td><\/tr>\n<tr><td>236<\/td><td><\/td><\/tr>\n<tr><td>237<\/td><td>            <span class='c'>\/\/ If the overlay should be cut when the mat is cut (as if it were actually on the mat), set this to true.<\/span><\/td><\/tr>\n<tr><td>238<\/td><td>            <span class='key'>attached<\/span> : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>239<\/td><td><\/td><\/tr>\n<tr><td>240<\/td><td>            <span class='c'>\/\/ If 'attached' is true, we can make the overlay look a touch more realistic by<\/span><\/td><\/tr>\n<tr><td>241<\/td><td>            <span class='c'>\/\/ allowing the highlights of the mat stipple to bleed through, as if the ink of the<\/span><\/td><\/tr>\n<tr><td>242<\/td><td>            <span class='c'>\/\/ overlay got rubbed off over time.<\/span><\/td><\/tr>\n<tr><td>243<\/td><td>            <span class='key'>use_highlight_preserving_mask_layer<\/span> : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>244<\/td><td><\/td><\/tr>\n<tr><td>245<\/td><td>            <span class='c'>\/\/ You can optionally provide function to apply to the overlay layer...<\/span><\/td><\/tr>\n<tr><td>246<\/td><td>            <span class='c'>\/\/ this example works well for a dark signature on a lightish mat.<\/span><\/td><\/tr>\n<tr><td>247<\/td><td>            <span class='key'>apply<\/span> : function()<\/td><\/tr>\n<tr><td>248<\/td><td>            {<\/td><\/tr>\n<tr><td>249<\/td><td>                <span class='c'>\/\/ style for a dark signature<\/span><\/td><\/tr>\n<tr><td>250<\/td><td>                JPSL.setLayerStyle({<\/td><\/tr>\n<tr><td>251<\/td><td>                    <span class='key'>bevel<\/span> : {<\/td><\/tr>\n<tr><td>252<\/td><td>                        <span class='key'>style<\/span>             : \"emboss\",<\/td><\/tr>\n<tr><td>253<\/td><td>                        <span class='key'>technique<\/span>         : \"smooth\",<\/td><\/tr>\n<tr><td>254<\/td><td>                        <span class='key'>globallight<\/span>       : <span class='b'>true<\/span>,<\/td><\/tr>\n<tr><td>255<\/td><td>                        <span class='key'>depth<\/span>             :  1,<\/td><\/tr>\n<tr><td>256<\/td><td>                        <span class='key'>size<\/span>              :  0,<\/td><\/tr>\n<tr><td>257<\/td><td>                        <span class='key'>highlight_opacity<\/span> : 50,<\/td><\/tr>\n<tr><td>258<\/td><td>                        <span class='key'>shadow_opacity<\/span>    : 36,<\/td><\/tr>\n<tr><td>259<\/td><td>                        <span class='key'>up<\/span>                : <span class='b'>false<\/span>,<\/td><\/tr>\n<tr><td>260<\/td><td>                        <span class='key'>soften<\/span>            : 0,<\/td><\/tr>\n<tr><td>261<\/td><td>                    }<\/td><\/tr>\n<tr><td>262<\/td><td>                })<\/td><\/tr>\n<tr><td>263<\/td><td>            },<\/td><\/tr>\n<tr><td>264<\/td><td>        }],<\/td><\/tr>\n<tr><td>265<\/td><td><\/td><\/tr>\n<tr><td>266<\/td><td>        <span class='c'>\/\/ an 'omit' of true causes this mat to be skipped; perhaps useful while testing<\/span><\/td><\/tr>\n<tr><td>267<\/td><td>        <span class='key'>omit<\/span>   : <span class='b'>false<\/span>,<\/td><\/tr>\n<tr><td>268<\/td><td>    },<\/td><\/tr>\n<tr><td>269<\/td><td><\/td><\/tr>\n<tr><td>270<\/td><td>    <span class='c'>\/\/ Additional mats go here if you like. Each appears \"on top of\" the mats listed earlier.<\/span><\/td><\/tr>\n<tr><td>271<\/td><td><\/td><\/tr>\n<tr><td>272<\/td><td>    ]<\/td><\/tr>\n<tr><td>273<\/td><td>})<\/td><\/tr>\n<\/table>\n\n\n<p class='h1' id='running'>Running The Script<\/p>\n\n<p>Running is as simple as invoking   <span class='nobr'>&#8220;<span class='fn'>Jeffrey's Mat Builder<\/span>&#8221;<\/span>.\nin the   <span class='nobr'>&#8220;<span class='fn'>File &gt; Scripts<\/span>&#8221;<\/span>\nmenu. (It may be worth while to assign a keyboard shortcut to it via\n<span class='nobr'>&#8220;<span class='fn'>Edit &gt; Keyboard Shortcuts<\/span>&#8221;<\/span> to make turnaround quicker while tweaking the script.)<\/p>\n\n<p style='margin-top:50px'>That's it. It's not for the faint of heart. Good luck. Did anyone read this far?<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>A few (low-resolution) examples...<\/p> <p>So, I've been working on and off for a while on a Photoshop script that builds photo-realistic fake matting around images. The script is not done yet, but I'll present what I have in the hopes it's helpful to someone, and that perhaps I can get some good feedback for improvements.<\/p> <p>Let me say up front that the process is a bit complex, somewhat out of necessity because I want very good results, but also because I haven't done the work to wrap the script up in a tidy hand-holding user interface.<\/p> <p style='margin: 50px 0 [...]","protected":false},"author":1,"featured_media":0,"parent":251,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/1716"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=1716"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/1716\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/251"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=1716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}