Reverse Search

<%= form_for :image, ~p"/search/reverse", [multipart: true], fn f -> %>

Basic image similarity search. Finds uploaded images similar to the one provided based on simple intensities and uses the median frame of animations; very low contrast images (such as sketches) will produce poor results and, regardless of contrast, results may include seemingly random images that look very different.

Upload a file from your computer, or provide a link to the page containing the image and click Fetch.

<%= file_input(f, :image, class: "input js-scraper") %>
<%= url_input(f, :url, name: "url", class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly") %>

Optional settings

<%= label(f, :distance, "Match distance (suggested values: between 0.2 and 0.5)") %>
<%= number_input(f, :distance, value: 0.25, min: 0, max: 1, step: 0.01, class: "input") %>
<%= submit("Reverse Search", class: "button") %>
<% end %> <%= cond do %> <% is_nil(@images) -> %> <% Enum.any?(@images) -> %>

Results

<%= for match <- @images do %> <% end %>
  Image  

<%= link("##{match.id}", to: ~p"/images/#{match}") %>

<%= if image_has_sources(match) do %> <%= link("Source", to: image_first_source(match)) %> <% else %> Unknown source <% end %>

<%= render(PhilomenaWeb.ImageView, "_image_container.html", image: match, size: :thumb, conn: @conn) %>

<%= match.image_width %> x <%= match.image_height %> - <%= round(match.image_size / 1024) %> KiB

<%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: Tag.display_order(match.tags), conn: @conn) %>
<% true -> %>

Results

We couldn't find any images matching this in our image database.

<% end %>