Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 5102 overlay images proposal #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions kinds/5102.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
layout: default
title: Image Overlay
description: Job request to overlay two images.
---

# Input

Clients must provide exactly two `"i"` tags specifying the two images to overlay. The supported input types are:
- `"url"`
- `"job"` (content field must be a URL)

One of the `"i"` tags must specify the `"background"` [marker](https://github.com/nostr-protocol/nips/blob/master/90.md), which specifies that this input image is used as the background image.

# Params

## `position`

Description:
Specifies the position of the "foreground" image relative to the origin point, using an `x:y` coordinate pair denominated in pixels. The origin point (0,0) is the top left corner of the "background" image.

A higher value in the x-axis means more to the right. A higher value in the y-axis means more downward. Only positive values are allowed.


Usage:
```
["param", "position", "x:y"]
```

Example: position the "foreground" image 50 pixels to the right of the origin, 25 pixels down from the origin.
```
["param", "position", "50:25"]
```


# Output

A link to the generated image(s)

# Example 1

## Generates an output image based on the input prompt and params

```json
{
"content": "",
"kind": 5102,
"tags": [
[ "i", "https://some-url.net", "url", "background" ],
[ "i", "https://some-thing.net", "url"],
["param", "position", "100:100"]
]
}
```