# Converting CUBE to ICC

**URL:** <https://forums.creativeclouddeveloper.com/t/converting-cube-to-icc/5907>\
**Category:** UXP Plugin API\
**Tags:** react, uxp\
**Created:** [February 22, 2023, 7:59pm UTC](https://forums.creativeclouddeveloper.com/t/converting-cube-to-icc/5907 "2023-02-22T19:59:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverOBrien](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@OliverOBrien](https://forums.creativeclouddeveloper.com/u/OliverOBrien)\
**Post date:** [February 22, 2023, 7:59pm UTC](https://forums.creativeclouddeveloper.com/t/converting-cube-to-icc/5907/1 "2023-02-22T19:59:33Z")

</div>

Greetings every curious soul!

I am in a bit of a bind.

I would like to set the 3DLUT file of a ColorLookUp adjustment layer automatically.

Using the action recorder I have managed to extract that the batchplay action should look like this

```auto
const actionObj = [
            {
              _obj: "set",
              _target: [
                {
                  _enum: "ordinal",
                  _ref: "adjustmentLayer",
                  _value: "targetEnum",
                },
              ],
              to: {
                _obj: "colorLookup",
                lookupType: {
                  _enum: "colorLookupType",
                  _value: "3DLUT",
                },
                name: lutAbsolutePath,
                LUTFormat: {
                  _enum: "LUTFormatType",
                  _value: "LUTFormatCUBE",
                },
                profile: {
                  _data: profile, // this is a variable
                  _rawData: "base64",
                }
,
                LUT3DFileData: {
                  _data: base64, // this is also a variable
                  _rawData: "base64",
                },
                LUT3DFileName: lutAbsolutePath,
              },
              _isCommand: true,
            },
          ];

```

The three variables are:

- `lutAbsolutePath` is the name you will see in the 3DLUT file input
- The `base64`, which is the .cube file encoded in base64.
- The `profile`, which is a the .icc file encoded in base64

The rest is static

The .cube was easy, read the file with `uxp.storage`, load the string, encode to base64 and stuff it in the action object.  
But I cannot figure out how to get the .icc file.

Loading in the LUT manually is selecting the ColorLookUp adjustment layer and loading in the .cube.  
I never even touch anything .icc related.  
So I assume it is generated from the .cube

The `profile` cannot be any other .icc base64 encoded profile, it has to be one linked to the .cube.

But I have no idea how to generate that .icc file.

Any thoughts?

Thank you ❤

---

<div class="post-metadata">

**Author:** ![dotproduct](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@dotproduct](https://forums.creativeclouddeveloper.com/u/dotproduct)\
**Post date:** [February 22, 2023, 11:15pm UTC](https://forums.creativeclouddeveloper.com/t/converting-cube-to-icc/5907/2 "2023-02-22T23:15:12Z")

</div>

As far as I know, from tinkering around with this myself a few years ago, Photoshop converts all input LUTs to ICC profiles when you load the LUT through the menu. It’s true that you can record the underlying action but the data that is necessary (i.e. the profile) comes from Photoshop itself. I’ve never been able to automate this. So if you come up with a solution I’d be super interested as well 😊 Unfortunately Photoshop makes a number of assumptions (some of them wrong) when converting LUTs to ICCs, in particular when dealing with HDR LUTs…
