Please have a happy and safe Halloween – Watch for Children
There is another option for using Photoshop functionality that I will be talking about here. If you are running Windows you can automate Photoshop and some other Adobe applications with OLE automation objects. This opens up possibilities for using Photoshop functionality within applications using general purpose programming languages such as C# or VB.Net. Ole Automation only makes sense if you have a need to combine Photoshop capabilities and other functionality that is not easily available within Photoshop. For instance, if you plan to use SQL Server or SQLlite along with image processing then building scripts that run entirely within Photoshop is probably not the best option. The application I describe is a standalone Windows desktop app built using Visual Studio 2015, VB.Net and SQLite.
Here is a small code snippet from my PSAuto class to give you a sense of how OLE automation might be done in VB.Net. The code uses Photoshop references that were added to the working project. These references must be added to allow Photoshop functionality to be accessed within Dot Net. This is just one possible approach that could be used for automation.
Imports Photoshop Public Structure pDocInfo Public _title As String Public _author As String Public _authPos As String Public _capt As String Public _captionWrtr As String Public _keywords As String Public _copyrighted As PsCopyrightedType Public _copyrightNotice As String Public _ownerURL As String End Structure Private Function doCreatPsApp() As Application If _psApp Is Nothing Then _psApp = New Application() _psApp.DisplayDialogs = PsDialogModes.psDisplayNoDialogs End If Return _psApp End Function Private Function doOpenPSDoc(ByVal path As String) As Document Dim psdoc As Document = Nothing Try Dim psapp As Application = doCreatPsApp() psdoc = psapp.Open(path) Catch ex As Exception Throw End Try Return psdoc End Function Public Function PopulateDocInfo(ByVal doc As Document, ByVal dinfo As pDocInfo) As Document doc.Info.Title = dinfo._title doc.Info.Author = dinfo._author doc.Info.AuthorPosition = dinfo._authPos doc.Info.Caption = dinfo._capt doc.Info.CaptionWriter = dinfo._captionWrtr doc.Info.Keywords = dinfo._keywords doc.Info.Copyrighted = dinfo._copyrighted doc.Info.CopyrightNotice = dinfo._copyrightNotice doc.Info.OwnerUrl = dinfo._ownerURL Return doc End Function
Over the past few months I have been publishing calendar downloads on my blog with a new featured photograph every week. I release two versions of each calendar with North America or international week formatting. The difference being that one has weekdays starting on Sunday and the other Monday. Each calendar includes a 5×7 high resolution image at 300ppi in horizontal or vertical orientation. My approach to creating calendars is to use .psd files of static calendar content as templates. New images and text are then added and secure PDF documents are generated.
Here is the process for publishing the calendars and blog post images:
The steps outlined above are repetitive and tedious work. Just the kind of thing the computer should handle for a user. The entire workflow for creating PDF calendars and blog post images can be automated with a little work. The process can also easily be driven by information stored in a database using something like SQLite. The database can store everything including calendar templates, original source images, logo images, copyright information, titles, text data, calendar layout configurations, processing logs, etc. The user need only select a source image and enter some text fields. The application handles all aspects of document creation and information storage autonomously. The whole process takes a few seconds at most. Using a data driven approach also allows previous documents to be regenerated on demand.
My application is around 80% complete as of now. The prototype app can select and size images, add standard and image specific file/copyright information, load appropriate calendar templates, modify text content and add images as layers to the calendar templates. All information is stored in a local SQLite database. The app can use either an existing instance of Photoshop or start a new instance as necessary for processing.
Of course application scripting is not something everyone will need or want to do. It is good to know the capability exists just in case you ever need it. For me it is a way to combine my passions for photography and code.
By inclination I’m a regional photographer. Regional mostly implies within a few hundred miles for most of my photography with a few exceptions. I was born and raised in Utah and I have a strong attachment to the Four Corners States having lived in three and traveled in all.
By far the most naturally spiritual place I’ve ever encountered is Northern New Mexico. It is a land with civilizations going back at least a thousand years and probably far longer. The Spanish came to civilize the Puebloan peoples in 1598 and destroyed much of the rich culture that thrived there. Thankfully they didn’t succeed completely. They did leave behind a blend of cultures and religions including the beginnings of iconic New Mexico colonial architecture.
Part of the reason why Spanish architecture is so well adapted here is because it fits comfortably with traditional Puebloan building styles. The existing construction techniques practiced by native peoples were perfect for adobe churches and official buildings. A quick stroll around any town in New Mexico will make the point about how well New Mexican architecture has served the people for hundreds of years.