Python Forum
how to compare two different size images in python and find corresponding pixel value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to compare two different size images in python and find corresponding pixel value
#1
[I'm currently doing this project in which I have two similar images, however they are in slightly different angles. Think of it as shifting left, right, up, down, but not in the z-axis, only x and y-axis are changed. Is it possible to compare these images, and let's say I have a value in the first image (340,150), what methods can I use to find that pixel in the second image, and since the second image was shifted won't the pixel value shift as well? How do I solve this problem thanks! Huh Big Grin
Reply
#2
I'm not quite sure the problem. Are the images different sizes?

Is your example of (340, 150) the width and height of the image or x and y of where it is displayed? "Pixel Value" isn't a term I'm familiar with, however...

Have you used pygame? It has the image.get_rect() feature that will measure and image for you. You can then compare the width and height of the two images that way. You can also use the center of the image to locate it on the screen so that the two images will be in the same location regardless of size.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to properly extract mathematical equations and images from PDF for a Python RAG c IchNar 2 97 Jan-27-2026, 11:53 PM
Last Post: Pedroski55
  Looping through each images in a give folder Python druva 1 2,577 Jan-01-2025, 08:46 AM
Last Post: Pedroski55
  Python 3.13 : def setup size HansieB 6 2,431 Dec-02-2024, 11:12 AM
Last Post: buran
  Python code for alignment and font size 1418 0 1,405 Jan-14-2024, 03:56 AM
Last Post: 1418
  Voxel to pixel graphics voicemail 3 2,748 Nov-19-2023, 09:45 AM
Last Post: paul18fr
  How to do "fixed size" (wrapping) math in Python? AlexanderWulf 13 8,635 Jul-19-2023, 04:13 PM
Last Post: deanhystad
  Pixel color and action Sartre 4 8,728 Apr-13-2023, 03:26 AM
Last Post: Sartre
  Dynamic pixel display jerryf 2 2,049 Mar-17-2023, 07:26 PM
Last Post: jerryf
  compare and find the nearest element ? mr_gentle_sausage 4 2,727 Jan-15-2023, 07:11 AM
Last Post: DPaul
Question Opening small size browser with python selenium not work, need help greenpine 0 2,801 Feb-07-2022, 11:36 AM
Last Post: greenpine

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020