GithubHelp home page GithubHelp logo

qumuase / ela Goto Github PK

View Code? Open in Web Editor NEW
29.0 1.0 2.0 9 KB

ELA 全称:Error Level Analysis ,汉译为“错误级别分析”或者叫“误差分析”。通过检测特定压缩比率重新绘制图像后造成的误差分布,可用于识别JPEG图像的压缩。

Home Page: http://tmac.wang/2017/09/ErrorLevelAnalysis--ELA(%E9%94%99%E8%AF%AF%E7%BA%A7%E5%88%AB%E5%88%86%E6%9E%90)%E5%9B%BE%E7%89%87%E6%8A%80%E6%9C%AF%E8%AF%A6%E8%A7%A3/

ela error-level-analysis

ela's Introduction

ELA

ELA 全称:Error Level Analysis ,汉译为“错误级别分析”或者叫“误差分析”。通过检测特定压缩比率重新绘制图片后造成的误差分布,可用于识别JPEG图片的压缩。

维基百科:ELA是对JPEG有损压缩的数字数据中的压缩影片进行分析。 ELA技术可参考 Neal Krawetz先生 在其 07年论文 中的详细介绍。

原理

把图片分割成很多8x8个正方形中的1像素点,对每一个小块进行单独的色彩空间转换。每次对 JPG 图片的修改,都会进行第二次转换。两次转换自然会存在差异,ELA 就是靠对比这种差异来判断图片的哪部分被修改过。

  • 点,指画面中的重复纹理或者类似数据,重复纹理在ELA分析的时候应该表现出近似的颜色,细节较多的区域数据差异也应该大。
  • 线,是不同颜色大面之间的交界线,相同反差边缘应该表现出近似的ELA结果。反差越大,ELA值越高,线条越清晰。
  • 面,纯色面不存在差异,也就不存在ELA,黑色或黑色着色。

如果非JPEG图片包含可见的网格线(8×8个正方形中的1像素点),则表示图片由JPEG格式转换为非JPEG格式(例如PNG)。 如果图片是原始PNG,则ELA是边缘和纹理生成非常高的值。如果ELA沿边缘和纹理产生弱结果(黑色或黑色着色),则PNG可能是由JPEG转化而来的。

示例

  1. http://www.errorlevelanalysis.com 是专门做ELA分析的网站,可惜现在已经关闭了。但还是保留了一个示例作为参考(请留意嘴唇、衬衫以及眼睛,这些部分与其周围因素是有所不同的,根据推测是经过修改的,区域变亮):
  2. Jonas Wagner 的测试(可以看到假的部分图片明显高亮于其周围区域):
  3. 原始照片在重新保存期间具有高度的变化(高ELA值)。后续的任何操作都将降低ELA值,产生较暗的ELA结果:
原图

原ELA

重新保存一次:

二次保存图

二次保存后ELA

修改图片内容(复制了绿皮书及放置了恐龙玩具):

修改后图片

修改后ELA

局限性

  • ELA只是一种算法,由于其分析压缩的性质,无损压缩的数据(如PNG图片)及图片色彩减少到256色以下(转换为GIF图),ELA 是没有作用的。
  • 如果图片被重新保存多次,那么它可能完全处于最小错误级。在这种情况下,ELA将显示黑色图片,且不能使用该算法来识别修改。 目前这个算法并不是完全可靠的,尤其是经过多次压缩的图片。

拓展

Neal Krawetz先生演讲文档 https://29a.ch/ 也有其他关于图片处理的技术,比如: 自动化图片裁剪主题区域(非暴力裁剪中心区域)的 smartcrop.js 介绍页 | 示例页 | 测试页 | GitHub 图片滤镜 Film Emulator 测试页 | GitHub

参考资料:
· http://www.hackerfactor.com/
· http://www.wired.com/images_blogs/threatlevel/files/bh-usa-07-krawetz.pdf
· http://www.errorlevelanalysis.com/
· http://fotoforensic.com/tutorial-ela.php
· https://29a.ch/
· https://en.wikipedia.org/wiki/Error_level_analysis

ela's People

Contributors

qumuase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tony-hou rock999

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.