This paper presents a novel framework for optimizing digital image forensics that aims to effectively identify and mitigate image tampering attacks. The proposed system enhances the accuracy and resilience of forensic techniques by accurately localizing areas of tampering while utilizing cost-effective algorithms for processing. The study indicates that this approach significantly outperforms existing methods, addressing key challenges in the field of digital image security.