Choose analytics

Essential browser storage remembers your tool settings. Optional analytics helps us understand site use and loads only if you accept it. Image files, filenames and submitted URLs are not sent to analytics.

Read the Cookie Policy
Skip to content
CompressByURL
CompressConvertResizeTarget sizeBy URLWebsite scannerBlog
Start compressing
Homechevron_rightBlogchevron_rightWebsite audits
Website audits

Why an image URL opens in your browser but fails to compress

Seeing an image in a tab does not grant another website permission to read its pixels. Separate a normal image display from cross-origin processing before blaming the URL or trying unsafe proxy workarounds.

SV
Saipavan V
Aug 24, 20264 min read

Updated Oct 2, 2026

An image URL meets CORS: topic-specific technical illustration
Editorial illustration

The short answer

  • checkBrowser display and pixel access have different rules.
  • checkCheck public accessibility, redirects, and supported image content.
  • checkUse local files or a bounded public retrieval path without sharing credentials.
On this page
  1. Understand display access versus processing access
  2. Check whether the URL is a public image response
  3. Fix CORS at the source when you control the host
  4. Use a narrowly scoped public-fetch fallback when needed
  5. Keep format and animation errors separate
  6. Build a useful error report without exposing secrets

Understand display access versus processing access

MDN explains that cross-origin images without the appropriate permission can taint a canvas. A page may display the image while export or pixel reading is blocked. That protects data across origins; it is not evidence that the photograph is corrupt.

Confirm the failure stage. Did retrieval fail, decoding fail, or did export fail after drawing? Keep those stages separate in a developer error report. An ordinary navigation to the image URL establishes that your browser can display something under its current conditions, not that another site can safely retrieve and process the same bytes.

Check whether the URL is a public image response

Open the intended direct resource and inspect its response through a workflow you control. A share-page URL can return HTML rather than an image. A signed URL can expire. A hotlink-protection rule can behave differently across request contexts. Record the final URL and actual content type when available.

Avoid using a secret or token-bearing URL in a public diagnostic workflow. If the resource belongs to an authenticated account, download it through the service’s permitted workflow and use the local-file mode instead. Do not paste cookies, authorization headers, or credentials into a tool to imitate your logged-in session.

Fix CORS at the source when you control the host

If you own the image host, configure the appropriate cross-origin policy for the processing application and verify the actual response. Client-side attributes alone cannot grant permission the server did not provide. Check redirects and cached responses because they can alter the final headers seen by the browser.

Make the policy as specific as your use requires. Do not weaken access controls on private content simply to silence a development error. Public decorative assets and private user documents have different requirements. Test the expected processing origin and preserve normal authentication boundaries for protected resources.

Use a narrowly scoped public-fetch fallback when needed

CompressByURL can retrieve validated public HTTP or HTTPS image resources through a limited server path when browser access is insufficient. The fetched bytes return to the browser for compression. This is a public image workflow, not a generic proxy or an authenticated session relay.

The service checks destinations and redirects and enforces content, time, and byte budgets. Private network targets and unsafe responses can be rejected. A retrieval failure may therefore reflect a deliberate boundary rather than a CORS bug. Read the displayed error and choose a permitted local-file path when you have the right to download the source.

Keep format and animation errors separate

A successful fetch still needs a supported static image that the browser and tool can decode. An HTML error response saved with an image extension is not a valid image. Animated content is outside CompressByURL’s optimization scope, even when it uses a familiar WebP or AVIF extension.

Inspect the source independently if decoding fails. Preserve the original and avoid changing its extension as a supposed conversion. For an owned static image, try a known valid local file to distinguish retrieval from decoding. Use the error category to guide the next step rather than repeating the same URL without new evidence.

Build a useful error report without exposing secrets

Record the public URL only when it is safe to share, the failure stage, browser information, and the visible error code. Remove private tokens and unrelated account data. A small description of whether the resource is public, redirects, and opens outside an authenticated session can narrow the investigation.

If you simply need an optimized replacement for an image you own, download it normally and use Upload Files. Local bytes remain in your browser. If you need repeatable direct-URL processing, correct the source policy or use the bounded public workflow. Keep the destination public and supported rather than introducing a credential-forwarding workaround.

ObservationInvestigate
Displays but canvas export failsCross-origin pixel access policy
URL returns a webpageUse the actual public image resource
Works only when logged inUse an authorized download and local mode
Public fetch rejectedDestination, redirect, type, or budget boundary

Common questions

Can I solve CORS by adding a client-side header?

The source server controls cross-origin permission. A client cannot grant itself access to protected remote pixels.

Can the tool fetch my private intranet image?

No. Its server retrieval path is limited to safe public destinations. Use a permitted local download and browser compression instead.

Sources and further reading

Technical references for the concepts in this guide. Examples with hypothetical values are illustrations, not measured results.

  • MDN: cross-origin images and tainted canvasesnorth_east
  • MDN: CORS guidenorth_east
SV

Saipavan V

Saipavan V writes practical guides for CompressByURL on browser-first image optimization, website image audits, and web performance. His articles connect technical explanations with steps you can verify on your own site.

More about the author

On this page

  1. Understand display access versus processing access
  2. Check whether the URL is a public image response
  3. Fix CORS at the source when you control the host
  4. Use a narrowly scoped public-fetch fallback when needed
  5. Keep format and animation errors separate
  6. Build a useful error report without exposing secrets
  7. Common questions
  8. Sources and further reading

Try it with your images

Local files stay on your device.

Import a public image URLRetrieve a safe public static image, then process it in your browser.arrow_forwardCompress your imagesCompare measured output files while local image bytes stay in your browser.arrow_forward

Explore the topics

Web performancechevron_rightWebsite auditschevron_rightDeveloper guideschevron_rightImage optimizationchevron_right

Keep going.

A few guides for your next useful fix.

View all guides arrow_forward
arrow_outward
Website audits4 min read

What a website image scanner can find, and what needs a browser

Understand HTML image discovery, lazy source hints, srcset candidates, fetch limits, and the difference between a static inventory and a rendered performance audit.

Sep 3, 2026
arrow_outward
Website audits3 min read

How to find large images on a website

A useful audit separates transfer weight, intrinsic pixel dimensions and rendered size. One number cannot tell you whether an image is actually a problem.

Aug 18, 2026
arrow_outward
Website audits5 min read

An image-focused PageSpeed checklist for developers

Audit website images in a useful order: inventory, dimensions, format, loading, layout stability, and deployment verification. Includes an evidence worksheet.

Sep 23, 2026
Mascot organizing image cards for optimization

Compress images locally, from a URL, or from a webpage.

Reduce file size, convert formats and prepare web-ready assets in your browser.

Open the free image compressor
CompressByURL

Make images lighter. Keep local files private.

BlogAbout & contactPrivacyTermsCookies