AminetAminet
Search:
84782 packages online
About
Recent
Browse
Search
Upload
Setup
Services

gfx/misc/PGMKey.lha

Mirror:Random
Showing: i386-aros icongeneric icon
No screenshot available
Short:Find double pictures by id\'s. V1.2
Author:Nagilum
Uploader:nagilum chillout org
Type:gfx/misc
Architecture:m68k-amigaos
Date:2000-03-02
Requires:OS3.0+,020+,Shell
Replaces:PBMKey.lha
Distribution:Aminet
Download:gfx/misc/PGMKey.lha - View contents
Readme:gfx/misc/PGMKey.readme
Downloads:481

Archive content:
 PGMKey (1180 bytes)		- the binary
 PGMKey.readme (2229 bytes)	- this readme
 PGMKey.s (3930 bytes)		- the source (asm)
 setnote (593 bytes)		- an example script

What's the use ?
 You can use this program to find pictures having the same content, 
 even when they have different size.

Why PGM ?
 This program can be used to create ID's for PGM-pictures.
 You may ask yourself, why the the hell PGM and not jpeg, iff or png ?
 Well, the first reason is that PGM has a very simple structure,
 and the second is that for all important formats exist command-line
 converters to PGM.
 This program requires 256 Grayscale pictures in PGM to work,
 those pictures start with P5 in the header and can easily created
 for example from jpeg: djpeg -grayscale ...
 This programm was written in about 4 hours and i know it's not very
 clean, but it works (even fast).

How does it work ?
 The program calculates the average over the whole picture, then splits
 the picture into 64 pieces and calculates the average for each piece,
 then depending on if the average from the piece is lower/equal 
 or higher to the total average it sets a bit in the id to 0 or 1.
 64 pieces create 64 bits, this id will be printed as a 16 digits hex number.
 Usually the ID remains the same if the picture is scaled.

You could use a script like the one included (setnote) to put the pictures id
in the filename, after that you could sort the files by the id and easily
remove double pictures. If you want to use pattern for selecting the pictures
just type:  spat setnote Pictures/#?.jpg  (for example).

Version history:
	1.0 - initial announcement
	1.1 - fixed a bug in the args parsing, increased the filename buffer
	      (thx to Jose Andias for the impulse to release this update)
	1.2 - forgot to increase the loop count for the filename loop, 
	      finally got the name correct PGM - Portable Gray Map .-)

DISCLAIMER: THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE OR LOSS
OF DATA OR WHATEVER CAUSED BY PGMKey. ANYONE USES IT WITHOUT WARRANTY.


Contents of gfx/misc/PGMKey.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                  544    1180  46.1% -lh5- 52e8 Mar  1  2000 PGMKey
[generic]                 1197    2229  53.7% -lh5- 6828 Mar  1  2000 PGMKey.readme
[generic]                 1485    3930  37.8% -lh5- 0a20 Mar  1  2000 PGMKey.s
[generic]                  298     593  50.3% -lh5- 718a Feb 29  2000 setnote
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         4 files    3524    7932  44.4%            Mar  1  2000
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>