1

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

like:

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 – steeldriver Jun 26 '17 at 7:35
  • I added picture example, please have a look. – Thomas G. Lau Jun 26 '17 at 7:36
  • Did you look at the tutorial I linked? anyhow this seems to be a question about image processing, not Unix/Linux – steeldriver Jun 26 '17 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 '17 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.