ScreenshotNeo

BlogHow-to

How to Convert an Image Into a Website URL

Upload an image to public hosting, copy its direct file URL, and verify it works in HTML, Markdown, and private browsing.

By the ScreenshotNeo team1 October 20267 min read

Direct answer: upload the image to a service that serves files publicly, then copy the image’s direct delivery URL. For a quick manual upload, use Imgur. For repeatable application uploads, use an image platform such as Cloudinary. A direct URL returns the image file itself; a viewer or share URL may return an HTML page, require sign-in, or depend on permissions.

What an image URL must do

A usable image URL points to the image resource, not merely to a page that displays it. Opening the URL should load the image without an account, and an HTTP request should return an image content type such as image/png, image/jpeg, or image/webp.

  • Publicly reachable: the destination can fetch it without your browser session or a login cookie.
  • Stable enough for your use: the host retains the file and does not unexpectedly change the path.
  • Embeddable: the URL works in the exact HTML, Markdown, CMS field, or API that will consume it.
  • Appropriate for the data: public links can be viewed by anyone who obtains them. Do not publish sensitive images through an unrestricted URL.

Option 1: Create a direct URL with Imgur

Imgur is the fastest manual route. Imgur says uploaded content can be located with a direct URL link. See Imgur’s upload and sharing instructions.

  1. Open Imgur and select New post.
  2. Choose the image file or drag it into the upload dialog.
  3. Open the uploaded image. On desktop, use Copy image address; in the mobile web or app flow, use Copy link.
  4. Paste the resulting URL into your HTML, Markdown, CMS, or form.
  5. Open the URL in a private browser window before publishing.

If you upload while signed out, save the direct link immediately. Imgur warns that it cannot locate an anonymous upload later without that link. Sign in when you need to manage uploads over time.

Use the Imgur URL in HTML

<img src="https://i.imgur.com/example.png" alt="Description of the image">

Use it in Markdown

![Description of the image](https://i.imgur.com/example.png)

Option 2: Upload through Cloudinary for applications

Cloudinary is designed for programmatic uploads and delivery. Its upload flow accepts a local file, buffer, stream, remote URL, or data URI and returns a secure_url. You can also assign a stable public_id and apply delivery transformations. Read the Cloudinary upload documentation and transformation documentation.

  1. Create a Cloudinary environment.
  2. Choose an authenticated upload or an explicitly configured unsigned upload preset.
  3. Send the file from your server, SDK, or upload endpoint.
  4. Read the returned secure_url, which is the canonical HTTPS delivery URL for the original asset.
  5. Store the URL or the asset’s public_id, rather than asking users to upload the same file again.

Keep API secrets and signing credentials on your server. Do not put an API secret in browser JavaScript.

Minimal cURL upload example

curl https://api.cloudinary.com/v1_1/YOUR_CLOUD_NAME/image/upload \\
  -F file=@./photo.png \\
  -F upload_preset=YOUR_UNSIGNED_PRESET

The JSON response contains the delivery URL. In an authenticated setup, use the authentication method required by your Cloudinary account instead of an unsigned preset.

Python upload example

import requests

with open("photo.png", "rb") as image_file:
    response = requests.post(
        "https://api.cloudinary.com/v1_1/YOUR_CLOUD_NAME/image/upload",
        files={"file": image_file},
        data={"upload_preset": "YOUR_UNSIGNED_PRESET"},
        timeout=60,
    )
response.raise_for_status()
asset = response.json()
print(asset["secure_url"])

Node.js upload example

import fs from "node:fs";

const form = new FormData();
form.append("file", new Blob([fs.readFileSync("photo.png")]));
form.append("upload_preset", "YOUR_UNSIGNED_PRESET");

const response = await fetch(
  "https://api.cloudinary.com/v1_1/YOUR_CLOUD_NAME/image/upload",
  { method: "POST", body: form }
);
if (!response.ok) throw new Error(`Upload failed: ${response.status}`);
const asset = await response.json();
console.log(asset.secure_url);

Option 3: Use a GitHub-hosted image

For public project assets, GitHub can host an uploaded image and provide an anonymized Camo URL on githubusercontent.com. GitHub notes that anyone who receives that URL may view the image or video. Use this for assets intended to be public, not confidential media. See GitHub’s anonymized URL documentation.

Commit the file to a repository or use GitHub’s documented upload workflow, then copy the resulting image address. Repository history, permissions, and future file moves affect durability, so keep important production media in storage you control.

Option 4: Cloud storage or a static deployment

Object storage and static hosting work when you control the deployment. Google Drive’s API can upload image data as a Drive File resource, but a normal sharing link commonly opens a viewer or requires permissions, so it is not automatically a direct embeddable image URL. Cloudflare Pages Direct Upload can deploy prebuilt assets to its network when the image belongs to a static site or project. See the Google Drive upload guide and Cloudflare Pages Direct Upload documentation.

Direct URL versus viewer or share URL

Check Direct image URL Viewer/share URL
Response The image bytes Usually an HTML page
Authentication Works without your login session May require sign-in or permission
Embedding Suitable for <img> and Markdown Often renders a page or fails
Content type image/* Often text/html

A URL ending in .png or .jpg is not proof by itself; servers can use any path. Verify the response and test the URL in the destination where it will be used.

Verify the URL before publishing

  1. Open the URL in a private or incognito window.
  2. Run a header request and inspect the status, redirects, and content type:
curl -I -L "https://example.com/path/to/image.png"

Look for a successful status and an image/* content type. A redirect is usually fine if the consuming system follows redirects; some APIs reject redirects, so test the exact integration.

  1. Paste the URL into the final HTML, Markdown renderer, CMS, or API field.
  2. Check the image on both desktop and mobile if layout or responsive behavior matters.

Common problems and fixes

Symptom Likely cause Fix
A page opens instead of the image You copied a viewer/share URL Open the image itself and copy its image address, or use the provider’s delivery URL.
Works for you but not visitors The URL requires your login, cookies, or a private permission Make the asset public or use a delivery URL intended for anonymous access.
Broken image after moving files The provider path or repository location changed Use a stable asset identifier and update references deliberately; keep ownership of the hosting account.
CMS rejects the link Redirects, unsupported content type, or provider filtering Check with curl -I -L, then use an HTTPS URL that returns the image directly.
Image is too large or slow Original dimensions or file size are excessive Resize or optimize at delivery time where supported, and serve an appropriate format.
Anonymous Imgur upload cannot be found The direct link was not retained Save the link at upload time; sign in for ongoing management.
Private image became public An unrestricted or anonymized URL was shared Remove the public asset and move sensitive media to authenticated storage.

Performance, reliability, and cost considerations

  • Performance: choose a host with delivery optimization or CDN support when images are viewed frequently. Resize large originals instead of sending them to every device.
  • Reliability: keep the hosting account under an organization you control, document retention behavior, and avoid relying on an anonymous upload for a long-lived product.
  • URL durability: store the provider’s stable asset ID or public ID alongside the URL so you can reconstruct delivery links if needed.
  • Privacy: treat every public or anonymized URL as shareable. Use access-controlled storage for private files.
  • Cost: compare storage, bandwidth, transformation, and request charges for your traffic. Provider limits and plans vary; do not assume a free tier is permanent.

Or skip the browser setup

If what you really need is an image of a webpage, use ScreenshotNeo instead of building browser automation and hosting the resulting file yourself. It accepts a URL and returns a PNG, JPEG, WebP, or PDF. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. An MCP server lets AI agents take screenshots, inspect pages, and capture PDFs.

See the ScreenshotNeo API documentation for all options. This one-call example saves a WebP response:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

There are 1,000 free screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

FAQ

Can I turn an image into a URL without uploading it?

No. A browser needs a network-accessible location. You must upload or deploy the file somewhere that serves it publicly, or host it on infrastructure you control.

Usually not. Standard Drive links commonly open a viewer and may require permission. Use a service’s documented direct delivery mechanism or another host intended for embedded files.

Should I use a URL shortener?

Shorteners add a redirect and can hide the final content type. Use the direct delivery URL when the destination accepts it.

Can anyone see an image with a public URL?

Anyone who obtains an unrestricted or anonymized URL may be able to view the image. Do not publish confidential material through public links.

What should I save in my database?

Save the delivery URL plus the provider, asset or public ID, original filename, and any transformation settings. The ID gives you a way to rebuild the URL if delivery rules change.