is it possible to use command line program to replace a section within PNG when it match sample picture?


When weather report in PNG match the image of "sun.png", replace that specific section on weather-report.png to sun.png while leave other content in weather-report.png untouched. enter image description here

if cloud image match right bottom "Selection_003.png" in "Hong_Kong.png", then replace that specific section with "Selection_004.png"

  • Sounds like you're talking about template matching - see this OpenCV template matching tutorial Jun 26, 2017 at 7:35
  • I added picture example, please have a look. Jun 26, 2017 at 7:36
  • Did you look at the tutorial I linked? anyhow this seems to be a question about image processing, not Unix/Linux Jun 26, 2017 at 11:14
  • Placing a high resolution image into a TTY screenshot might only end up looking "kinda stupid", after all the hard work you put into making it work. :) May I suggest the following idea: scrape the original text, and transform it to a webpage: HTML+CSS+PNG/SVG images. Better yet, if that weather system has some sort of API (which returns structured data: JSON, XML, CSV, whatever ..) use that instead of TTY screen scraping.
    – Kaz
    Jul 24, 2017 at 19:28


You must log in to answer this question.

Browse other questions tagged .