- JavaScript 53.8%
- CSS 35.8%
- HTML 10.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| vendor | ||
| app.js | ||
| index.html | ||
| README.md | ||
| styles.css | ||
Anime Screenshot Search
A small browser-based page that finds which anime, episode, and moment a screenshot comes from. Upload, paste, or drop a screenshot (or enter a direct image URL), and the page finds the scene with trace.moe and shows details and links from AniList.
Features
- Search by uploading an image, pasting one from the clipboard, dropping one anywhere on the page, or entering a direct image URL
- Show the best match's episode, timestamp, and similarity
- Warn when the match is probably wrong (similarity below 90%) and list up to five possible matches to compare
- Show the remaining trace.moe search quota as soon as the page loads, refreshed after each search
- Show AniList titles, cover image, description, genres, episode count, and average score
- Link to AniList and MyAnimeList, plus streaming, info, and social sites (grouped by type, with language where AniList provides it) and trailers
- Explain failures in plain language, such as an image link that points to a web page instead of an image, an exhausted quota, or a network error
- Light and dark themes that follow the system color-scheme preference
Using the Page
Open index.html in a modern browser with an internet connection. You can also serve the folder locally, for example with python3 -m http.server, and open http://localhost:8000.
Provide a screenshot in any of these ways, then select Search:
- Select Upload image and choose a file (up to 25 MB, trace.moe's limit).
- Paste an image you copied (Ctrl+V or Cmd+V).
- Drag an image file, or an image from another web page, onto the page.
- Enter a public, direct image URL. It must open the image itself, so album and share-page links (such as Imgur album pages) won't work.
Uncropped screenshots of the full frame work best. trace.moe trims black borders automatically. If the best match shows a low-similarity warning, open Possible matches and select another title to see its details.
trace.moe limits how many searches each IP address can make. The banner above the results shows how many remain.
APIs and External Resources
- trace.moe finds the scene. The page sends uploaded images to
POST /searchand image URLs toGET /search, both withcutBorders(trims black borders) andanilistInfo(adds titles for the possible-matches list).GET /mereports the remaining quota. - AniList GraphQL API provides anime details, MyAnimeList IDs, external links, and trailer information.
- DOMPurify 3.4.17 sanitizes AniList's HTML description before it's shown. A copy is included in
vendor/, so the page doesn't depend on a CDN for it. - Google Fonts provides DM Sans, DynaPuff, and Manrope.
- When AniList doesn't supply a site icon, the page loads one from Google's favicon service, which sends that site's domain to Google.
The page makes all requests directly from the browser. Uploaded images go to trace.moe. API availability, rate limits, and cross-origin policies are controlled by each service.
Security
- AniList's description HTML is sanitized with DOMPurify. If DOMPurify fails to load, the description is shown as plain text instead.
- Links and images from API responses are used only if they are
httporhttpsURLs, which blocksjavascript:and other schemes. - A Content Security Policy in
index.htmlallows scripts only from the page's own files, and network requests only to trace.moe and AniList. If you add a new API or asset host, add it to the policy, or the browser will block it.
Accessibility
- Text colors meet WCAG AA contrast (at least 4.5:1) in both themes, on cards and on the page background.
- Search progress, results, and errors are announced through a status region.
- Every control works with the keyboard, and all external links open in a new tab.
- With reduced motion enabled, animations are shortened.
Styling
The page uses a glass-inspired interface and a palette of burgundy, pink, and pale cyan. Light and dark themes are selected with prefers-color-scheme. Colors are CSS custom properties at the top of styles.css. Accent-colored text uses --accent-text and --accent-text-strong, which are tuned for contrast separately from the button and border accents. DynaPuff is used for headings, DM Sans for body text, and Manrope for supporting typography.
Files
index.html: page structure and Content Security Policystyles.css: responsive layout, palette, and light/dark themesapp.js: image input, trace.moe and AniList requests, error handling, and result renderingvendor/purify.min.js: DOMPurify 3.4.17vendor/DOMPurify-LICENSE.txt: DOMPurify's license (Apache 2.0 or MPL 2.0)
There is no build step or package manager configuration.
Updating DOMPurify
Download the new release's dist/purify.min.js from npm, check it against the registry's integrity hash, and replace vendor/purify.min.js. Update the version number in this README.
Validation
The JavaScript can be syntax-checked with:
node --check app.js
HTML and CSS diagnostics are available in VS Code. Live API behavior requires an internet connection and a screenshot or public image URL.
AI Usage Disclosure
Two AI coding assistants were used in this project:
- GitHub Copilot gave implementation suggestions and debugging help while the original version was built, and helped write the first version of this README.
- Claude Code (Anthropic's Claude Opus 5.5) reviewed the code in November 2026 and then made the changes from that review:
- image upload, paste, and drag-and-drop, which replaced the list of image-hosting sites
- error handling, request timeouts, and a corrected quota display
- scene timestamps, low-similarity warnings, and the possible-matches list
- external links grouped by type
- security changes: a local copy of DOMPurify, URL checks, and the Content Security Policy
- color-contrast and screen-reader fixes
- a rewrite of this README
Claude Code tested its changes with automated browser tests in Chromium and Firefox using mocked API responses, plus one live search against trace.moe and AniList. Those test scripts aren't part of this project.