Skip to main content
Participant
August 14, 2018
Question

Liquify .msh file format specifications

  • August 14, 2018
  • 3 replies
  • 2289 views

I'd like to read and manipulate Liquify's pixel displacement meshes (i.e. .msh files) programmatically. In the early days of Liquify about 10 years ago, the meshes were relatively easy to read but several MB in size. In recent versions of Photoshop, Adobe introduced some kind of compression in the .msh format to make the files much smaller, but as a result they became much harder to interpret. Are the specifications of modern .msh files documented somewhere? I couldn't find anything about .msh files here: Adobe Photoshop File Formats Specification. Alternatively, has someone managed to reverse engineer the format?

On a side note, is there a more appropriate forum somewhere for technical questions about Photoshop internals?

This topic has been closed for replies.

3 replies

Ivan Kuckir
Known Participant
January 10, 2020

The structure of a .MSH file is this:

uint32: version

ASCII string: "yfqLhseM"

uint32: 2

uint32: width

uint32: height

And the rest is the data. If version=2, the data is just 32-bit floats. If version=3, the zeros are RLE-compressed. That is how I implemented it in my photo editor https://www.Photopea.com 🙂 

Participant
December 3, 2019

When you apply (Press OK) from the Liquify menu, Scriping Listener Plugin dumps the mesh into a CSV string (search for "String.fromCharCode" in the log file your Photoshop creates).

ScriptingListenerplugin 

 

It will look something like this, but a lot longer:

// =======================================================
var idsetd = charIDToTypeID( "setd" );
    var desc65 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref19 = new ActionReference();
        var idfilterFX = stringIDToTypeID( "filterFX" );
        ref19.putIndex( idfilterFX, 1 );
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref19.putEnumerated( idLyr, idOrdn, idTrgt );
    desc65.putReference( idnull, ref19 );
    var idfilterFX = stringIDToTypeID( "filterFX" );
        var desc66 = new ActionDescriptor();
        var idFltr = charIDToTypeID( "Fltr" );
            var desc67 = new ActionDescriptor();
            var idLqMe = charIDToTypeID( "LqMe" );
            desc67.putData( idLqMe, String.fromCharCode( 0, 0, 0, 4, 121, 102, 113, 76, 0, 0 ) );
        var idLqFy = charIDToTypeID( "LqFy" );
        desc66.putObject( idFltr, idLqFy, desc67 );
    var idfilterFX = stringIDToTypeID( "filterFX" );
    desc65.putObject( idfilterFX, idfilterFX, desc66 );
executeAction( idsetd, desc65, DialogModes.NO );

 

Known Participant
January 22, 2019

Hey @nickevans74, hope all is well.

Did you ever get any further info on .msh files? I'm trying to import a .msh file, created in the liquify tool, into Photoshop 3D (CC 19.1.5).

I found a clue left by here: Re: Is it worth it for me to learn scripting in PS? (It's at the end of the post.) I still haven't been able to get it to read the file.  There is almost no documentation about these files. I've searched for converters as well and have not had any luck. Any tips?

Thanks, ~Joe D