Skip to content

Discord bot to search anime by screenshots with trace.moe api

Notifications You must be signed in to change notification settings

leso1337/Anime-Searcher-Discord-Bot

Repository files navigation

This bot can help you to find any anime by screenshot.

INSTRUCTION:

Installation:

1) Create mysql table:
CREATE TABLE `guilds` (
`guild_id` varchar(21) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`workchannel` varchar(18) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`lang` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'eng'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; )
2) Install node.js,
3) Edit config.json
( if you don't have trace.moe token set "trace_moe_token": false )
,
4) Start bot: cmd -> node index.js
5) Add bot to your server,
6) Set work channel: +setchannel #channel_name
7) Send any anime image to work channel ;D

How does it works?

Bot sends image to https://trace.moe/ and resend reult to your work channel.

Why I can't find the search result?

Possible reasons:
1. Your image is not an original anime screenshot.
2. The anime has not been analyzed yet.
3. Your image is flipped.
4. Your image is of bad quality.
Regarding 1. You may try to use SauceNAO and iqdb.org which is best for searching anime artwork.
Regarding 2. New animes currently airing would be analyzed around 24 hours after TV broadcast. Long-running animes / cartoons are excluded at this stage. See "What animes are indexed" at the bottom of this page.
As for 3. If you image comes from AMV / Anime Compilations, it's likely its flipped horizontally.
As for 4. The image search algorithm is designed for almost-exact match, not similar match. It analyze the color layout of the image. So, when your image is not a full un-cropped original 16:9 screenshot (i.e. cropped image), the search would likely fail.
Color is an important factor for the correct search, if heavy tints and filters are applied to the screenshot (i.e. grayscale, contrast, saturate, brightness, sepia), too much information are lost. In this case the search would also fail. The Edge Histogram can solve this issue by ignoring colors and only search edges. But I am running out of computing resource to support another image descriptor.
Image transform is also an important factor. If the image is not scaled without maintaining original aspect ratios (i.e. elongated, flipped, rotated), the search would also fail.
Text occupied too much of the image. Large texts on the image would interfere the original image. The system is not smart enough to ignore the text.
If you image has too little distinguish features (e.g. dark images or images with large plain blocks of plain colors), the search would also fail.
Searching with a real photo (of an anime) definitely won't work.

Examples of bad screenshots


Extra border added


Bad Screenshot

Original Screenshot

In case your screenshot has extra borders, please trim off the extra borders before you search.


Cropped Image


Bad Screenshot

Original Screenshot

Cropping the image would result a huge loss of information content.


Flipped image


Bad Screenshot

Original Screenshot

This screenshot from AMV - Animegraphy 2015 flipped the original scene in the anime.


Tinted images


Not a good Screenshot

Original Screenshot

Tinted images are hard to search. Because the applied filter effects heavily distorted the information in the original screenshot. The color layout image descriptor can no longer find such images.


Old Japanese Anime


Sample Screenshot

Anime of this age are not indexed.


Not from Anime Screenshot


Sample Screenshot

You should try SauceNAO and https://iqdb.org/ to search anime / doujin artwork.


Not Japanese Anime


Sample Screenshot

Tom and Jerry is obviously not a Japanese Anime.


Dark image


Sample Screenshot

Dark images are hard to distinguish using the colorlayout descriptor.


Low resolution image


Sample Screenshot

Your image should be at least 320x180px to search effectively.


Examples of acceptable screenshots

Slightly distorted size


Acceptable Screenshot

Original Screenshot


Reasonably sized subtitles


Acceptable Screenshot

Original Screenshot


A frame of GIF


Acceptable Screenshot

Original Screenshot

If the color distortion is acceptable, GIF is also OK.


Drawings of the anime scene


Acceptable Screenshot

Original Screenshot

Acceptable Screenshot

Original Screenshot

Acceptable Screenshot

Original Screenshot

The search image does not has to be taken from anime screencap directly. You can use drawings of some scenes as long as it is similar to the original one.


Info from trace.moe.

About

Discord bot to search anime by screenshots with trace.moe api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published