Hacker News new | past | comments | ask | show | jobs | submit login
Detecting Photoshopped Faces by Scripting Photoshop (peterwang512.github.io)
88 points by skilled on July 11, 2019 | hide | past | favorite | 21 comments



I was surprised recently to learn that photoshop has an api (albeit poorly documented). I was able to get quite a ways with it and am using it to control photoshop via a hardware MIDI device. Really handy to have physical knobs and buttons for certain things.


> albeit poorly documented

That's an understatement. Haha The docs are basically worthless. There is so many different versions, all scattered around the web. Not to mention, most of them are in the form of a .pdf that is hundreds of pages, with a terrible search function. hah

With that said, Palette [1] is an awesome company that builds exactly what you are describing. I've used there products for a bit now for PS work, and love it!

[1] https://palettegear.com/index


Was looking at potentiometers (knobs) the other day, and it's crazy that you basically have to make your own in Arduino if you want one that isn't from Palette. Microsoft infamously made the Dial that has the unfortunate design flaw of sliding off the Surface monitor it's supposed to stick to.


There are other options. Controllers with knobs are often made for music, but can also be used effectively for stuff like 3D and image/video editing. A popular choice for editing photos is the Behringer X-Touch Mini.

Also, you generally don't want potentiometers for these applications, but rotary encoders. Pots = physical min and max position; encoders = infinite rotation. So for example, when you're switching from one photo to the next, pots would annoyingly keep the old value, while encoders will switch to the correct value. Just a little detail, but it's nice to have to right term to search for.


That Microsoft "Dial" was the triumph of gimmickry over functionality.


Now that would be a good research paper: documenting the Photoshop API.


Tell me about it. I remember trying to write scripts for CS....5? Digitally flicking through a PDF was an absolute pain, and their "JavaScript reference" is a stretch when you could barely write any JavaScript for it. Tonnes of basic features missing from the reference meant coming up with your own extravagant way of performing basic tasks.

I don't know what it's like now, but I'm glad I don't use Photoshop anymore to worry about it


I have a Surface tablet for drawing, and I hacked together a setup where I draw with my right hand and hold a PS3 navigation controller in my left[0]. The buttons are mapped, using XPadder [1], to keyboard shortcuts (layer up/down, undo, etc) and the joystick I use to pan around. I don't use Photoshop, but I think most of the common functions can be reached via keyboard. XPadder is sophisticated enough to allow for modes, e.g. holding R1 changes the meaning of all the other buttons.

There are still some features that I want which I think would need an exposed API. For example, setting an anchor point on the canvas, then triggering a quick jump back to it.

[0] https://www.gamestop.com/ps3/accessories/playstation-move-na... [1] https://xpadder.com/?lang=english&country=US


Is this similar to the device used in the movie Barbarella [1968], where the keyboard virtuoso is able to cause a series of odd expressions to appear on Barbarella's face?


Everything about Adobe software is poorly documented except the rental extraction agreements, and even they are pretty unclear. They bought Linda.com to try and improve their 'how to' shambles online. I'm running the last iteration of the DVD creative suite on an old mac and the product registration server has been taken offline by Adobe so there are endless pop up verification screens that just 404'd at adobe. Call center calls are necessary to validate software that was bought and wholly owned... Brings up an important point about how long you actually own functional old software before it becomes obsolete


This algorithm actually aims not to detect photoshopped faces, but faces warped by the Face-aware Liquify tool. I wonder how it compares to state-of-the-art commercial forensic solutions (see [1]), and more generally how DL algorithms compare with such closed source forensic tools.

[1] http://www.bbc.com/future/story/20170629-the-hidden-signs-th...


Technical question I haven't dug into:

How much of this predictive power has to do with facial recognition, and how much has to do with compression artifacts, pixel value abberations, etc?

Edit: the paper addresses this question:

> One question is whether the network is using “high-level” cues, such as shape and symmetry, or simply relying on “low-level” cues, such as resampling artifacts.

> although the network may be taking advantage of certain low-level cues, such as resampling, some performance is retained even when those are averaged away

Seems that it's both... but I'm not sophisticated enough to read this paper deeply.


This is pretty great. I'd like to see this run in bulk on some prominent Instagram accounts and re-posted in new accounts named "[instagram-name]-unedited".


If I use portrait mode and the camera software softens my face [1], would that image be flagged as having been photoshopped?

[1] https://www.theatlantic.com/technology/archive/2018/12/your-...


It should be, surely.


How do you draw the line at acceptable changes from the RAW image? Are HDR images photoshopped? How about ones where the white balance has been adjusted? Or that an unsharp mask has been applied?


Maybe a first pass filter would be "has a selection been made according to the image content".

So an unsharp mask would be a no, unless it was applied to background or everything except faces (for example).

Things like white balance don't count, unless you are selective according to the image content; so you could white-balance according to the whole-image statistics, but _not_ "recognise the is a face and use white-balance to, eg, lighten or reduce contrast in that area".


Damn that's a great idea. I might acctually try and write that.


Double the correction magnitude to distort them in the other direction! That'll give 'em narrow scowls, puffy jowls, and beady little eyes.


The Taco Bell menu used to show a photo of three perfectly identical tacos for the three-taco meal. It was so appealing that I ordered them, and was so disappointed that I complained when they did not look perfectly alike. Sure wish I had this tool back then.

Fooled me one, shame on you. Fool me twice, shame of me. Fooled me with three perfect tacos, dammit!

This might have helped to detect taco clones:

https://headt.eu/How-to-Detect-Image-Manipulations-Part-2/


RIP Instagram models




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: