3

Does PHP have enough low-layer methods in order to implement an image comparison metric such as SSIM (structural similarity)?

Do you have an SSIM function for PHP? I've been searching but I can't find it. I will try to make it on my own, by converting code from C.

Thank you!

Kevin Van Ryckegem
  • 1,915
  • 3
  • 28
  • 55
  • You can probably do it with functions from the GD library, but I wouldn't want to do it :-) I'd find a shell command to do it and call it via `exec`. – Kryten Apr 24 '14 at 14:52
  • You could implement something as a PHP module, but Russell's or Kryten's advice seems the quicker way to do it. – halfer Apr 24 '14 at 14:54

1 Answers1

3

With GD it is theoretically possible to do any image processing that you would do in C (albeit probably rather more slowly). But what I have done in the past is to just write a simple C program to do the processing, and call it from PHP. This usually requires you to save the image to a temporary file, if it exists only in a database, but it allows you to use your existing C code without porting.

Russell Zahniser
  • 16,188
  • 39
  • 30