# Logo to Favicon & Social Share Image Generator (`mauberme/logo-to-social-images`) Actor

Give it your logo (SVG) and get every icon a website needs: browser favicons, Apple and Android app icons, plus the 1200x630 picture shown when your link is shared on social media or WhatsApp. Free during launch.

- **URL**: https://apify.com/mauberme/logo-to-social-images.md
- **Developed by:** [Mauberme](https://apify.com/mauberme) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Logo to Favicon & Social Share Image Generator

**What is it for?** A website needs its logo in many sizes: the small icon in the browser tab, the icon when someone saves the site to their phone, and the **picture that appears when a link is shared on WhatsApp, LinkedIn or X**. Give this tool your logo as an SVG file and get **all of them at once**, correctly sized.

Turn an **SVG logo** into a complete **favicon and social image set**: square **PNG or WebP icons** (16, 32, 48, 180, 192, 512 px by default — favicon, Apple touch icon, Android/PWA icons) plus a **1200×630 Open Graph image** with your logo centred on a brand colour and an optional title. Paste the SVG markup or give a URL; get back a dataset with a public link to every image.

Use it as an **SVG to PNG converter**, a **favicon generator**, an **app icon generator** or an **OG image generator** for websites, landing pages, Shopify/WordPress themes and link previews on Facebook, LinkedIn, X/Twitter, Slack and WhatsApp.

### Features

- Any number of **icon sizes** (8–2048 px), sharp at every size (the SVG is re-rendered, not upscaled).
- **Transparent or solid background** (`#ffffff`, `#0f172a`…) and optional **padding** for Apple touch icons.
- **Open Graph image 1200×630** with optional title, automatic black/white text for contrast.
- **PNG or WebP** output.
- Several logos per run (`svgs`), one set per logo.
- **Safe SVG handling**: every SVG is sanitised before rendering — `<script>`, `on*=` event handlers, `<foreignObject>`, animation elements, DTD entities and any external reference (`http:`, `file:`, `@import`, `url(http…)`) are removed or rejected. A malicious SVG cannot read files or make requests.

### Input example

```json
{
  "svg": "https://example.com/logo.svg",
  "sizes": [16, 32, 48, 180, 192, 512],
  "background": "transparent",
  "padding": 0,
  "format": "png",
  "ogImage": true,
  "ogTitle": "Acme Kitchen Studio"
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `svg` | string | – | SVG URL or SVG markup. |
| `svgs` | array | `[]` | More SVG URLs/markups (max 50 logos per run). |
| `sizes` | array of integers | `[16,32,48,180,192,512]` | Square icon sizes. |
| `background` | string | `transparent` | `transparent` or hex colour. |
| `padding` | 0–40 | 0 | Space around the logo in icons, % of size. |
| `format` | `png` | `webp` | `png` | Output format. |
| `ogImage` | boolean | `true` | Generate the 1200×630 image. |
| `ogTitle` | string | – | Title under the logo on the OG image. |
| `ogTextColor` | string | auto | Hex colour of the title. |

### Output example

One row per generated image:

```json
{
  "logo": 1,
  "source": "https://example.com/logo.svg",
  "kind": "icon",
  "size": "180x180",
  "width": 180,
  "height": 180,
  "format": "png",
  "bytes": 4246,
  "url": "https://api.apify.com/v2/key-value-stores/<storeId>/records/logo-1-180x180.png",
  "sanitizerRemoved": [],
  "error": null
}
```

The OG row has `"kind": "og"` and `"size": "1200x630"`. `sanitizerRemoved` lists anything the sanitiser stripped from your SVG. An invalid SVG produces a row with `error` and the run continues with the next logo.

### Pricing

**Free during launch.** This Actor has no usage fee of its own: you only pay Apify's standard platform usage for your runs (on the free Apify plan that is covered by your monthly credit). A pay-per-result price may be introduced later; Apify notifies users in advance of any price change.

### Limits

- Up to 50 logos per run, 20 icon sizes, sizes 8–2048 px.
- SVG max 2 MB; download timeout 20 s.
- Only public `http`/`https` URLs. Private networks, localhost and cloud metadata addresses are blocked, including through redirects.
- SVGs with DTD/entity declarations are rejected. External images, fonts and stylesheets referenced by the SVG are **not** loaded — embed raster images as `data:image/png;base64,…` if you need them.
- Text inside the SVG is rendered with the fonts available in the container (DejaVu). Convert text to paths for pixel-perfect brand typography.
- The SVG needs a `viewBox` or `width`/`height` so its size can be determined.
- `.ico` files are not generated; modern browsers accept PNG favicons (`<link rel="icon" type="image/png" sizes="32x32" href="…">`).

# Actor input Schema

## `svg` (type: `string`):

Public http(s) URL of an SVG file, or the SVG markup itself (starting with \<svg). The SVG is sanitised before rendering: scripts, event handlers, <foreignObject> and external references are removed.

## `svgs` (type: `array`):

Additional SVG URLs or SVG markups to process in the same run (max 50 logos in total).

## `sizes` (type: `array`):

Square icon sizes to generate. Defaults cover favicon (16, 32, 48), Apple touch icon (180) and Android/PWA (192, 512). Each between 8 and 2048, max 20 sizes.

## `background` (type: `string`):

"transparent" or a hex colour like #ffffff or #0f172a. The Open Graph image always gets a solid background (white when transparent).

## `padding` (type: `integer`):

Empty space around the logo inside each icon, as a percentage of the icon size (0-40). Around 10 is recommended for Apple touch icons.

## `format` (type: `string`):

Image format for all generated files.

## `ogImage` (type: `boolean`):

Create a 1200x630 social sharing image (Facebook, LinkedIn, X/Twitter, Slack, WhatsApp) with the logo centred.

## `ogTitle` (type: `string`):

Text shown under the logo on the Open Graph image (max 120 characters, wrapped to two lines).

## `ogTextColor` (type: `string`):

Hex colour for the title. By default black or white is chosen for best contrast with the background.

## Actor input object example

```json
{
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"> <defs> <linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"> <stop offset=\"0\" stop-color=\"#f97316\"/> <stop offset=\"1\" stop-color=\"#dc2626\"/> </linearGradient> </defs> <circle cx=\"100\" cy=\"100\" r=\"90\" fill=\"url(#g)\"/> <path d=\"M60 110 L90 140 L145 70\" fill=\"none\" stroke=\"#ffffff\" stroke-width=\"18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/> </svg>",
  "svgs": [],
  "sizes": [
    16,
    32,
    48,
    180,
    192,
    512
  ],
  "background": "transparent",
  "padding": 0,
  "format": "png",
  "ogImage": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"> <defs> <linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"> <stop offset=\"0\" stop-color=\"#f97316\"/> <stop offset=\"1\" stop-color=\"#dc2626\"/> </linearGradient> </defs> <circle cx=\"100\" cy=\"100\" r=\"90\" fill=\"url(#g)\"/> <path d=\"M60 110 L90 140 L145 70\" fill=\"none\" stroke=\"#ffffff\" stroke-width=\"18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/> </svg>",
    "sizes": [
        16,
        32,
        48,
        180,
        192,
        512
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mauberme/logo-to-social-images").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"> <defs> <linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"> <stop offset=\"0\" stop-color=\"#f97316\"/> <stop offset=\"1\" stop-color=\"#dc2626\"/> </linearGradient> </defs> <circle cx=\"100\" cy=\"100\" r=\"90\" fill=\"url(#g)\"/> <path d=\"M60 110 L90 140 L145 70\" fill=\"none\" stroke=\"#ffffff\" stroke-width=\"18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/> </svg>",
    "sizes": [
        16,
        32,
        48,
        180,
        192,
        512,
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("mauberme/logo-to-social-images").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "svg": "<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 200 200\\" width=\\"200\\" height=\\"200\\"> <defs> <linearGradient id=\\"g\\" x1=\\"0\\" y1=\\"0\\" x2=\\"1\\" y2=\\"1\\"> <stop offset=\\"0\\" stop-color=\\"#f97316\\"/> <stop offset=\\"1\\" stop-color=\\"#dc2626\\"/> </linearGradient> </defs> <circle cx=\\"100\\" cy=\\"100\\" r=\\"90\\" fill=\\"url(#g)\\"/> <path d=\\"M60 110 L90 140 L145 70\\" fill=\\"none\\" stroke=\\"#ffffff\\" stroke-width=\\"18\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/> </svg>",
  "sizes": [
    16,
    32,
    48,
    180,
    192,
    512
  ]
}' |
apify call mauberme/logo-to-social-images --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mauberme/logo-to-social-images"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tbXNvCipvN1Dkp1I1/builds/9n3fMkYyxnDZaNgCw/openapi.json
