Skip to content

Commit

Permalink
Merge branch 'nimitha' into transclude
Browse files Browse the repository at this point in the history
  • Loading branch information
nimithajalal committed Mar 25, 2024
2 parents a1e31a7 + 86f10ad commit 841247c
Show file tree
Hide file tree
Showing 25 changed files with 114 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ After running these steps, you'll see four images output in the same directory.

Here's the entire code sample. As a reminder, feel free to modify and change the prompt.

**IMPORTANT:** Note that this Node.js code uses imports and top-level `await`, so you must either use the `.mjs` extension on your script file or ensure you have a `package.json` with `type: "module"`.
<InlineAlert variant="warning" slots="title, text" />

IMPORTANT

Note that this Node.js code uses imports and top-level `await`, so you must either use the `.mjs` extension on your script file or ensure you have a `package.json` with `type: "module"`.

<CodeBlock slots="heading, code" repeat="2" languages="JavaScript, PYTHON" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Harnassing the Firefly Services APIs in PowerAutomate
description: This how-to guides you through the process of harnassing the Firefly Services APIs in PowerAutomate.
title: Integrating Firefly Services with Microsoft Power Automate
description: This how-to guides you through the process of integrating the Firefly Services APIs in PowerAutomate.
keywords:
- Adobe Firefly Services
- Firefly API
Expand Down Expand Up @@ -56,9 +56,9 @@ To complete this tutorial, you will need:

Our workflow will use the Firefly API to generate images. The steps involved are:

* Reading a set of prompts from a Microsoft list.
* Sending each prompt to Firefly.
* Take the result and send an email.
- Reading a set of prompts from a Microsoft list.
- Sending each prompt to Firefly.
- Take the result and send an email.

For simplicity's sake, this flow will be manually triggered, but certainly, but you could create a dynamically triggered workflow.

Expand Down
34 changes: 17 additions & 17 deletions src/pages/guides/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ Click **Add to Project** to add more APIs to the product profile in the same pro

Repeat [Step 2](./get-started.md#step-2-add-api-to-your-project) until you have added all these APIs:

* Firefly – Firefly Services
* Lightroom - Firefly Services
* Photoshop - Firefly Services
* Content Tagging - Firefly Services
- Firefly – Firefly Services
- Lightroom - Firefly Services
- Photoshop - Firefly Services
- Content Tagging - Firefly Services

### Step 5: Generate access token

You can click **Generate an access token** for quick experimentation or click **view the cURL command** to learn how to generate access tokens programmatically. [Learn more](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/implementation/) about how to do it.
Access tokens can be generated or refreshed in two ways:

- Manual generation: Click **Generate an access token** for quick experimentation using the Developer Console
- Programmatic generation: Click **view the cURL command** to learn how to generate access tokens programmatically. [Learn more](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/implementation/) about how to do it.

#### Scopes

Expand All @@ -115,18 +118,20 @@ Click **View scopes per service** to understand the services and scopes associat

![scopes](..//guides/images/scopes.png)

Sample cURL command:
Sample cURL command for generating an access token programmatically:

``` bash
curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>&scope=openid,AdobeID,session,additional_info,read_organizations,firefly_api,ff_apis'
```

The selected APIs will be listed in the left-hand side under **APIS**.
#### API Key

Grab your **API KEY (Client ID)** from the same screen.

The selected APIs will be listed in the left-hand side under **APIS**.

![Generate Access Token](..//guides/images/generate-access-token.png)

Congratulations! You have just generated an access token.
Expand All @@ -137,19 +142,14 @@ Once you have created your access token, you can follow the steps below to make

1. Open your terminal and paste the code below.
2. Replace the variables <YOUR_ACCESS_TOKEN> with the token you generated on the Adobe Developer Console.
3. Replace <YOUR_CLIENT_ID>. You can find this on the same page you generated your token on.
3. Replace <YOUR_CLIENT_ID>. You can find this on the [same page](get-started.md#api-key) you generated your token on.
4. Once all variables have been replaced you can run the command.

```bash
curl -X POST \
https://firefly-api.adobe.io/v2/images/generate \
-H 'x-api-key: <YOUR_CLIENT_ID>' \
-H 'Authorization: <YOUR_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"parameter1": "value1",
"parameter2": "value2"
}'
curl --request GET \
--url https://image.adobe.io/pie/psdService/hello \
--header "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
--header "x-api-key: <YOUR_CLIENT_ID>"
```

Congratulations! You just made your first request to the Firefly services API.
Expand Down
Binary file modified src/pages/guides/images/generate-access-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/pages/lightroom/api/lightroom_applyPresets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
layout: none
-----

<RedoclyAPIBlock src="/firefly-services/docs/lightroom_applyPresets.json" width="600px" disableSidebar hideTryItPanel />
<RedoclyAPIBlock src="/firefly-services/docs/lightroom_applyPresets.json" width="600px" disableSidebar hideTryItPanel />
12 changes: 3 additions & 9 deletions src/pages/lightroom/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,26 @@ This guide will assist you in:

### Get Started

[Getting Started Guide](./get-started.md)
[Getting Started Guide](../guides/get-started.md)

Get started with the Adobe Firefly Services.

<DiscoverBlock slots="link, text"/>

[Tutorials](./tutorials/)
[Tutorials](../guides/tutorials/index.md)

Explore our tutorials page for comprehensive guidance.

<DiscoverBlock slots="heading, link, text"/>

### API References

[Firefly API](../firefly-api/guides/api/generative_expand/index.md)
[Firefly API](..firefly-api/guides/api/generative_expand/index.md)

Integrate generative AI into your creative workflows.

<DiscoverBlock slots="link, text"/>

[Lightroom API](../lightroom/api/lightroom_applyPresets.md)

Unlock the potential of Lightroom in the cloud.

<DiscoverBlock slots="link, text"/>

[Photoshop API](../photoshop/api/photoshop_actionJSON.md)

Unlock the potential of Photoshop in the cloud.
Expand Down
45 changes: 26 additions & 19 deletions src/pages/photoshop/features/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
---
title: Features in Photoshop API
title: Adobe Photoshop API features
description: Learn about the available features in Photoshop API.
keywords:
- Adobe Photoshop API features
- Photoshop API features
contributors:
- https://github.com/archyposada
- https://github.com/khound
hideBreadcrumbNav: true
---

# Supported Features

This is a list of currently supported features in the Adobe Photoshop API, which is now available through Adobe Firefly Services.


## Photoshop Actions

An action is a series of tasks that you play back on a single file or a batch of files—menu commands, panel options, tool actions, and more. For example, you can create an action that changes the size of an image, applies an effect to the image, and then saves the file in the desired format. All of these taks could be executed in one API call.

Actions created in Photoshop produce an ATN file which can then be used to edit images programmtically using our API.

For more information on how to create Photoshop Actions, see the <a href="https://helpx.adobe.com/photoshop/using/actions-actions-panel.html" target="_blank">Adobe Help Center</a>
For more information on how to create Photoshop Actions, see the <a href="https://helpx.adobe.com/photoshop/using/actions-actions-panel.html" target="_blank">Adobe Help Center.</a>

#### Supported Input and Output formats
* PSD,
* PSD
* JPEG
* PNG
* TIFF
Expand All @@ -37,8 +43,8 @@ The following are known limitations:
You can choose to playback all of the tasks recorded in an Action or you can selectively choose a particular task within and exclude the rest.

Here are some examples of submitting and executing Photoshop Actions:
[Execute Photoshop Action with all recorded tasks](../code-sample/#photoshop-actions---play-all-actions-in-atn-file)
[Execute Photoshop Action with a specific task while excluding the rest](../code-sample/#photoshop-actions-play-a-specific-action)
- [Execute Photoshop Action with all recorded tasks](../code-sample/#photoshop-actions---play-all-actions-in-atn-file)
- [Execute Photoshop Action with a specific task while excluding the rest](../code-sample/#photoshop-actions-play-a-specific-action)

In this example we applied a custom Action called "Graphic Design." This ATN file had over 75 recorded Photoshop tasks including Select Subject, Camera Raw Filer adjustments, Content-Aware Fill, Transform, Fill Layer, and more.
![alt image](./psactions_example.png?raw=true "Original Image")
Expand Down Expand Up @@ -212,7 +218,7 @@ It enables users to
### Usage Recommendations
- Ensure that the input file is a PSD and that it contains one or more text layers.
- Please refer to [Font Handling](../photoshop/features/#font-handling) and [Handle Missing Fonts](../photoshop/features/#handle-missing-fonts-in-the-document) for a better understanding.
- You can find a code sample [here.](../code-sample/#making-a-text-layer-edit) is a code sample.
- You can find a code sample [here.](../code-sample/#making-a-text-layer-edit)

### Known Limitations

Expand All @@ -223,7 +229,7 @@ In this example, the font on the original image was altered using the Text API,

## Product Crop

The Product Crop endpoint facilitates smart cropping for images, automatically detecting the subject and ensuring it remains the focal point of the cropped image. Users can identify the product and specify the desired padding for their cropped image. You can see some sample code [here.](../code-sample/#applying-product-crop)
The Product Crop endpoint facilitates smart cropping for images, automatically detecting the subject and ensuring it remains the focal point of the cropped image. You can identify the product and specify the desired padding for their cropped image. You can see some sample code [here.](../code-sample/#applying-product-crop)

### Known Limitations
- The current model is trained to return a crop that respects the salient object within an image. There is a current known issue that when a person or portrait is contained within a salient object, the model will crop with the person as the focal area rather than the salient object that contains it. This is problematic in the case of an item where an image of a person is contained within a design (i.e. a t-shirt, collectible or art). Rather than crop to the intended item, the service will crop to the person within the item.
Expand Down Expand Up @@ -304,9 +310,7 @@ In order to be able to correctly operate on text layers in the PSD, the correspo
While referencing fonts in the API request, please ensure that the correct Postscript name for that font is used. Referencing to that font with any other name will result in the API treating this as a missing font.

The Photoshop APIs supports using the following category of fonts:
- Currently Installed Fonts on the server listed [here](/features/supported-fonts/)
- Fonts that you are authorized to access via [Adobe Fonts](https://fonts.adobe.com/fonts).
**Note:** Currently only available for OAuth tokens, JWT service token support is forthcoming.
- You can find a list of currently supported fonts [here](../photoshop/features/#photoshop-cc)
- Custom/Other Fonts: These are the fonts that are either owned by you or the ones that only you are authorized to use.
To use a custom font you must include an href to the font in your request. Look at the `options.fonts` section of the API docs for more information.
For including an href to the font in your request, please ensure the font file name to be in this format: `<font_postscript_name>.<ext>`, when it is being uploaded in your choice of storage. A sample `options.fonts` section will look like so:
Expand All @@ -319,7 +323,7 @@ The Photoshop APIs supports using the following category of fonts:
**Note:** This also applies to any other font present in the document which is not to be found in the first 2 categories above.

Here is an example usage of a custom font
[Custom font](../code-sample/#custom-font-in-a-text-layer)
- [Custom font](../code-sample/#custom-font-in-a-text-layer)

#### Handle missing fonts in the document.

Expand All @@ -333,15 +337,15 @@ For any textLayer edit/add operation, if the font used specifically for that lay
- `fail` to force the request/job to fail
- `useDefault` to use our system designated default font, which is: `ArialMT`

Here is an example usage of `manageMissingFonts` and `globalFont`. [Handle missing fonts](../code-sample/#example-5-dictating-actions-for-missing-fonts)
In this example we show you how to [andle missing fonts](../photoshop/code-sample/#dictating-actions-for-missing-fonts) using the `manageMissingFonts` and `globalFont` options.

### Limitations

- Most of the text attributes retain their respective original values. There are some attributes however that do not retain their original values. For example (and not limited to): tracking, leading, kerning.

### Supported Fonts

This is a list of all of the supported Postscript fonts for Photoshop API. We currently do not support custom fonts.
This is a list of all of the supported Postscript fonts for Photoshop API.

### Photoshop CC
| |
Expand Down Expand Up @@ -418,19 +422,21 @@ This is a list of all of the supported Postscript fonts for Photoshop API. We cu
- Create a new artboard from multiple input psd's

## Remove Background
The Remove Background endpoint can recognize the primary subject within an image and eliminate the background, providing the subject as the output. YOu can see a code sample [here.](../code-sample/#remove-background).<br />
The Remove Background endpoint can recognize the primary subject within an image and eliminate the background, providing the subject as the output. You can see a code sample [here.](../code-sample/#remove-background).<br />

Example of Remove Background with a sample image.
![alt image](./imagecutout_cutout_example.png?raw=true "Original Image")

## Create Mask
This endpoint allows you to can create a greyscale mask png file that you can composite onto the original image (or any other). You can find a code sample [here.](../code-sample/#generate-image-mask).<br />
This endpoint allows you create a greyscale mask png file that you can composite onto the original image (or any other). You can find a code sample [here.](../code-sample/#generate-image-mask).<br />

Note: If using this output for an input file in the Adobe Firefly API you must invert the mask which can be done using the Action JSON endpoint.

Example of Image mask with a sample image.
![alt image](./imagecutout_mask_example.png?raw=true "Original Image")

## Customized Workflow
You can make a 'customized workflow' by chaining different endpoints together. [Here](../code-sample/#generate-remove-background-result-as-photoshop-path) is an example using the Remove Background endpoint.
You can make a customized workflow by chaining different endpoints together. [Here](../code-sample/#generate-remove-background-result-as-photoshop-path) is an example using the Remove Background endpoint.


## Webhooks through Adobe I/O Events
Expand All @@ -446,8 +452,9 @@ As the names indicate, these event types represent events triggered by the indiv
#### Prerequisites needed to use the Event Provider

1. In order to use the Adobe I/O Events you will need to create a project on Adobe I/O Console.
2. You can follow the steps listed in [Getting Started](../getting-started/#getting-started-from-adobe-io-console) page if you haven't created one yet.
3. Create a Webhook application. [This](https://www.adobe.io/apis/experienceplatform/events/docs.html#!adobedocs/adobeio-events/master/intro/webhooks_intro.md) page gives all the details of what the skeleton of a basic application would look like. You can find a sample NodeJS application [here](https://github.com/AdobeDocs/cis-photoshop-api-docs/tree/main/sample-code/webhook-sample-app)
2. You can follow the steps listed in [Getting Started](../guides/gets-started.md) page if you haven't created one yet.
3. Create a [Webhook application](https://www.adobe.io/apis/experienceplatform/events/docs.html#!adobedocs/adobeio-events/master/intro/webhooks_intro.md)
- You can find a sample NodeJS application [here](https://github.com/AdobeDocs/cis-photoshop-api-docs/tree/main/sample-code/webhook-sample-app).


#### Registering the Webhook
Expand Down
74 changes: 0 additions & 74 deletions src/pages/photoshop/features/supported-fonts/index.md

This file was deleted.

11 changes: 9 additions & 2 deletions src/pages/photoshop/general-workflow/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
title: General Workflow of Photoshop API
description: General Workflow of Photoshop API
title: Adobe Photoshop API general workflow
description: Learn the general workflow of the Photoshop API
keywords:
- Photoshop API general workflow
contributors:
- https://github.com/khound
- https://github.com/archyposada
hideBreadcrumbNav: true
---

# General Workflow for Photoshop API

The typical workflow involves making one or more calls to our API, to edit PSD or other image files, and to create new image renditions.
Expand Down
Loading

0 comments on commit 841247c

Please sign in to comment.