> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trybloom.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit and adapt images

> Edit, resize, remove backgrounds from, and vectorize existing images.

Bloom can transform a completed generated image or an image uploaded to a Brand Library. Every operation returns a new image ID, leaving the source image unchanged.

## Edit an image

Describe what should change while keeping the rest of the image stable. Edits retain the source image's aspect ratio.

<Tabs>
  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://www.trybloom.ai/api/v1/images/$IMAGE_ID/edit \
      -H "x-api-key: $BLOOM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "brandSessionId": "<brand_id>",
        "prompt": "Make the headline bolder and leave more whitespace on the left.",
        "imageSize": "2K",
        "model": "pro"
      }'
    ```

    The response contains the new image ID and `status: "pending"`.
  </Tab>

  <Tab title="MCP">
    ```text theme={null}
    On the Acme launch image, make the headline bolder and leave more whitespace
    on the left.
    ```

    The agent calls `bloom_edit_image`, then retrieves the new image with `bloom_get_image` and `wait: true`.
  </Tab>
</Tabs>

## Resize an image

Resize uses image generation to reflow a completed raster image into another supported aspect ratio rather than only cropping it.

<Tabs>
  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://www.trybloom.ai/api/v1/images/$IMAGE_ID/resize \
      -H "x-api-key: $BLOOM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "brandSessionId": "<brand_id>",
        "targetAspectRatio": "9:16"
      }'
    ```
  </Tab>

  <Tab title="MCP">
    ```text theme={null}
    Resize the Acme launch image to 9:16 for Stories.
    ```

    The agent calls `bloom_resize_image`. The target ratio must differ from the source image, and vector images cannot be resized through this operation.
  </Tab>
</Tabs>

## Remove a background

Background removal produces a transparent PNG from a completed raster image.

<Tabs>
  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://www.trybloom.ai/api/v1/images/$IMAGE_ID/remove-background \
      -H "x-api-key: $BLOOM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "brandSessionId": "<brand_id>" }'
    ```
  </Tab>

  <Tab title="MCP">
    ```text theme={null}
    Remove the background from the Acme product image.
    ```

    The agent calls `bloom_remove_background`. Existing SVGs do not have a removable raster background.
  </Tab>
</Tabs>

## Vectorize an image

Vectorization converts raster artwork to SVG. It works best for logos, icons, and flat illustrations; photographs and soft-shaded artwork are poor candidates.

<Tabs>
  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://www.trybloom.ai/api/v1/images/$IMAGE_ID/vectorize \
      -H "x-api-key: $BLOOM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "brandSessionId": "<brand_id>" }'
    ```
  </Tab>

  <Tab title="MCP">
    ```text theme={null}
    Vectorize the Acme logo for use in print.
    ```

    The agent calls `bloom_vectorize_image`. The source must be a sufficiently large raster image rather than an existing SVG.
  </Tab>
</Tabs>

## Retrieve the result

API operations return `202 Accepted` with a new image ID. Call `GET /images/{id}?wait=true`; repeat the bounded wait if the result is still pending or generating.

MCP operations return the new image ID and tell the agent to call `bloom_get_image` with `wait: true`. For several independent results, the agent can call `bloom_list_images` once with all `image_ids`.

Do not treat a queued operation as finished. Present the image only after the retrieved status is `completed` and an `imageUrl` or `image_url` is available.

## Common failures

* The source image must exist and be accessible to the caller.
* A generated source must be complete before it can be transformed.
* The Brand ID must identify the brand that owns the operation.
* Each operation consumes credits and can return a billing error before work starts.
* Content-safety or provider failures can appear on the resulting image after the operation was accepted.

Use the [API reference](/api/openapi) for exact REST fields and errors, or [Available MCP tools](/mcp/tools) for the live-tool contract.
