Image::Seek(3pm)
β¨ Image::Seek β ok so basically ImgSeek but for Perl β¨
bestie. hi. you're looking at Image::Seek(3pm), and no cap, it's literally a port of ImgSeek to Perl. π Let's get into it.
πΈ NAME πΈ
Image::Seek β A port of ImgSeek to Perl π
π¦ SYNOPSIS π¦
okay so here's the whole vibe, verbatim, iconic, no notes:
use Image::Seek qw(loaddb add_image query_id savedb);
loaddb("haar.db");
# EITHER
my $img = GD::Image->newFromJpeg("photo-216.jpg", 1);
# OR
my $img = Imager->new();
$img->open(file => "photo-216.jpg");
# OR
my $img = Image::Imlib2->load("photo-216.jpg");
# Then...
add_image($img, 216);
savedb("haar.db");
my @results = query_id(216); # What looks like this photo?
remove_id(216); # Just remove id from database.
like. three different image libraries, pick your fighter, they all work. π«Ά
π DESCRIPTION π
So ImgSeek (that's http://www.imgseek.net/ btw) is an implementation of Haar wavelet decomposition techniques β yes, we're doing actual math here, main character energy fr β and its whole thing is finding similar pictures in a library. π
This module is a port of the ImgSeek library to Perl's XS. And the cute part? It can deal with image objects produced by the Imager, Image::Imlib2 and GD libraries. all three. she's flexible. π
π EXPORT π
None by default, bestie β you gotta ask for what you want. But these functions are all available:
π savedb($file)
Dumps the state of the norms and image buckets to the file $file. Save your work, queen. πΎ
π loaddb($file)
Loads a database of image norms produced by savedb. the glow-up in reverse. β¨
π cleardb
Clears the internal database.
β οΈ ok real talk, pay attention here: note that loaddb will load into memory a bunch of data that you may already have β it will duplicate rather than replace this data, so results will be skewed if you load a database multiple times without clearing it in between. it's giving messy. don't do it. clear first. π
π add_image($image, $id)
Adds the image object to the database, keyed against the numeric id $id. This will compute the Haar transformation for a 128x128 thumbnail of the image, and then store its norms into a database in memory. she's doing the math, you're just vibing. π
π remove_id($id)
remove id from database, and you should savedb to save the changed database. don't forget the save or it's gone gone. π
π query_id($id[, $results))
This queries the internal database for pictures which are "like" number $id. It returns a list of $results results (by default, 10); a result is an array reference. The first element is the ID of a picture, the second is a score. So for example:
query_id(2481, 5)
returns, in a shoot I have, the following:
[ 2481, -38.3800003528595 ],
[ 2480, -37.5519620793145 ],
[ 2478, -37.39896965962 ],
[ 2479, -37.2777427507208 ],
[ 2584, -10.0803730081134 ],
[ 2795, -7.89326129961427 ]
π¨ Notice that the scores go the opposite way to what you might imagine: lower is better. yes really. The results come out sorted, and the first result is the thing you queried for. so2481matched2481first, obviously, she knows herself. π
π addImage($id, $reds, $greens, $blues)
Internally used. π§
π add_image_magick($image, $id)
Internally used. π§
π add_image_gd($image, $id)
Internally used. π§
π add_image_imager($image, $id)
Internally used. π§
π add_image_imlib2($image, $id)
Internally used. π§
π constant
Internally used. π§
π queryImgID
Internally used. π§
π removeID
Internally used. π§
π results
Internally used. π§
π SEE ALSO π
http://www.imgseek.net/β the original, the blueprint, the mother. π
π§ SOURCE REPOSITORY π§
<http://github.com/wollmers/Image-Seek>β go look, go star, go contribute, iykyk. β
π MAINTAINER π
Helmut Wollmersdorfer <helmut.wollmersdorfer@gmail.com>
πΈ AUTHOR πΈ
Simon Cozens, <simon@cpan.org<gt> Lilo Huang, <kenwu@cpan.org> Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>
All the clever bits were written by Ricardo Niederberger Cabral; Simon Cozens just mangled them to wrap Perl around them. π iconic honestly, we love a modest king.
β COPYRIGHT AND LICENSE β
Copyright (C) 2005 by Simon Cozens, 2008 by Lilo Huang, 2015 Helmut Wollmersdorfer
This library is free software; as it is a derivative work of imgseek, this library is distributed under the same terms (GPL) as imgseek. π«Ά
ok that's the whole page bestie, you're fully caught up, go find some similar photos, slay. π β¨
perl v5.42.3 Β· 2026-08-19 Β· and that's Image::Seek(3pm), signing off, periodt. ππ¦π
π¦ where this page comes from
- ubuntu stonking: libimage-seek-perl 0.06-3build6 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms