Hi HellOfMice,
Are you looking for ideas to try or complete solutions? I have an idea
First you know the dimensions of the smaller looking for image LX,LY that you are looking for within the bigger image SX,SY.
My thought is to search for a small byte run in the horizontal direction say 32 pixels worth, adjustable of course.
if these match the 32 pixels starting in the upper left top of the original image then check 32 pixels down in the vertical
direction if these match (meaning a possible corner found) then XOR the search image you are looking for with the bigger image starting at the SX,SY position that matched as a possible image start and then check for all zeros within the LW,LH space, if all zeros you have found a matching space in the bigger image.
If not found then the next search moves over of course to check again.
Maybe it would be shorter ....
Another possibility is
Maybe ask ChatGPT or Bard how to do it and have it generate some code to do the search?
John Z