Greasy Fork is available in English.

Easy Compare

Compare images

Aŭtoro
Secant
Ĉiutagaj instaloj
0
Tutaj instaloj
412
Ratings
4 0 0
Versio
0.9.5
Kreita
2020/03/02
Ĝisdatigita
2022/04/25
Licenco
GPL-3.0-or-later
Aplikiĝas al
Ĉiuj retejoj

Easy Compare

book 介绍 Introduction

一个作用于任何页面的、用于方便地比较截图的用户脚本。多用于各大 PT 站点的对比截图比较,灵感来自于 PTP 的截图比较脚本,但源码完全不同。

Easy Compare is a userscript, that applied to any page, aiming to make screenshot comparison handy. This can be widely used in many PT sites. The idea comes from the official PTP Show comparison script, but the code is completely original.

balloon 特性 Features

  • 在任何页面,将鼠标移动到页面右上角,找到触发的按钮(灰色),等待按钮图标变绿后,点击,即可激活比较模式;

    Move the mouse cursor to the upper right of the page and try to find the button (in grey), wait till it turns into green and click it to active compare mode;

    icon icon

  • 可以在任何页面“就地”进行截图对比,无需重新下载上传;

    Compare screenshots in place without downloading/uploading images to other sites;

  • 支持不同的图床,有可扩展性;

    Support multiple image hosts, which can be configured and extended;

  • 进入截图比较模式后,鼠标悬浮在页面图片上方,即可在浏览器中央显示该图的原图。将鼠标在不同的图片上悬停,即可在浏览器中央切换不同图片的原图;

    When activated, hover your mouse above an image on the page, the original image of which will be displayed over the center of the page. Move your mouse among different images on the page and you can switch different original images of them over the center of the page;

  • 配合快捷键可以很方便地比较不相邻的图片;

    Non-adjacent images can be compared easily when using hot-keys;

  • 支持 Image Diff,即像素级别比较两张图片中的差异并通过颜色标出。该功能需配合 Shift 键使用,按下 Shift 键时,当前活动图片会作为基准图片,通过鼠标或键盘快捷键移动到其他图片上时(移动时需按住 Shift 不放),便会将基准图片与该图片进行比较,比较结束后结果会显示在浏览器中央,并可通过 ArrowUpArrowDownArrowLeftArrowRightI/iK/kJ/jL/l 快捷键调整该比较的阈值/敏感度。该功能核心代码来自于mapbox/pixelmatch

    Image Diff is supported, which is comparing two images pixel-wisely and marking all the different pixels with colors. This feature requires the Shift key. When Shift is pressed down, the active image will be used as the base image. When users move the cursor to another image or use the hot-keys to focus on another image (Shift needs holding in the mean time), the base image will be compared to that image, and the result will be displayed over the center of the page when diffing is finished. Users can use ArrowUp, ArrowDown, ArrowLeft, ArrowRight or I/i, K/k, J/j, L/l hot-keys to adjust the threshold/sensitivity of the diffing result. The image diff core function is from mapbox/pixelmatch;

  • 支持 Solar Curve 曲线滤镜,使用该滤镜可以很清晰地看到图像中的色带等瑕疵;

    Solar Curve filter is supported for better recognition of bandings or other defects in the image, making it more friendly to human eyes;

    Solar CurveComparisons of bandings under Solar Curve filter
    Solar CurveBandings under Solar Curve filter
  • 配合快捷键可以进行一些便捷操作,包括:

    Several hot-keys are supported for better user experience, including:

    键 Key功能Function
    Esc退出截图比较模式Deactivate compare mode
    Q/q半透明化截图比较界面,以便显示出原页面中的元素Semi-transparentize the interface, allowing user to view the elements on the page
    W/w跳到往前数第 num 张图片并显示Jump to the nth previous image and display
    E/e跳到往后数第 num 张图片并显示Jump to the nth next image and display
    Num Keynum 的值,默认是 1,有效值为 0-90 代表 10The value of n in "nth". 0-9 are valid numbers and 0 is recognized as 10
    Shift用于激活 Image DiffActivate Image Diff
    ArrowUp/I/i增加 Image Diff 阈值(0-1),降低敏感度Increase Image Diff threshold and decrease sensitivity
    ArrowDown/K/k降低 Image Diff 阈值(0-1),增加敏感度Decrease Image Diff threshold and increase sensitivity
    ArrowLeft/J/j增加阈值调整步长Increase the step when adjusting the threshold
    ArrowRight/L/l减小阈值调整步长Decrease the step when adjusting the threshold
    S/s开启/关闭 Solar Curve 曲线滤镜Toggle on/off Solar Curve filter
    A/a开启/关闭 S2lar Curve 曲线滤镜(相当于应用 2 次 Solar Curve 滤镜)Toggle on/off S2lar Curve filter (Solar Curve ^ 2)
    Ctrl + S/s保存当前显示的图片到本地Save the current displayed image to the local
    Ctrl + L/l清除图像缓存Clear image caches
    Ctrl + =/+放大图像Zoom in
    Ctrl + -/_缩小图像Zoom out
    Ctrl + I/i缩小图像到最小尺寸Zoom out to the minimum size
    Ctrl + P/p放大图像到最大尺寸Zoom in to the maximum size
    Ctrl + O/o恢复到图像原有尺寸Resize to the original size

dart 待办 TODOs

  • 支持更多图床,持续更新;

    Support more image hosts and keep updated;

  • 处理跳转链接,持续更新;

    Handle redirection prefixes and keep updated;

  • 对于不支持缩略图转原图的链接,通过请求超链接后猜测原图,或根据超链接站点做匹配,持续更新;

    For thumb images whose sources cannot be converted to original ones, make an HTTP request of the hyper link and guess (or match according to the link) the original image source;

  • 支持更多滤镜;

    Support more filters;

  • 使用 WebGL 进行加速。

    Accelerate using WebGL.

roller_coaster 演示 Demo

功能 Feature演示 Demo
BasicsDemo
Image DiffDemo
Solar CurveDemo

hammer_and_wrench 安装 Installation

请到 Greasy Fork 页面,配合 Tampermonkey 浏览器扩展安装使用。

Please go to Greasy Fork and install the usersript with Tampermonkey extension.

warning 注意 Notes

  • 本脚本使用 createImageBitmap(blob) 实现图像的解码。为了能够正常使用本脚本,请使用支持 createImageBitmap 的浏览器

    This script uses createImageBitmap(blob) to decode images. In order for the script to work properly, please use browsers that support createImageBitmap;

  • 部分站点有非常严格的内容安全策略限制,因此无法使用脚本内动态创建的 Worker,从而导致图像处理阻塞页面主线程的交互。若遇到此问题,Chrome 用户可以使用 Content Security Policy Override 这个扩展覆写网站的内容安全策略设置。以 Awesome-HD 为例,将该扩展的规则更改为

    [
      ["https://awesome-hd\\.me/", [
          ["script-src", "script-src blob:"]
      ]]
    ]
    

    [
      ["https://awesome-hd\\.me/", [
          ["script-src", "worker-src blob:; script-src"]
      ]]
    ]
    

    Some sites have strict Content Security Policy (CSP) settings, so dynamic constructed Workers in this script may not be available. In that case, Chrome users can use Content Security Policy Override extension to override the CSP settings of these sites. An example to overide CSP settings of Awesome-HD:

    [
      ["https://awesome-hd\\.me/", [
          ["script-src", "script-src blob:"]
      ]]
    ]
    

    or

    [
      ["https://awesome-hd\\.me/", [
          ["script-src", "worker-src blob:; script-src"]
      ]]
    ]
    

building_construction 贡献 Contribution

本脚本暂时不开放多人编辑权限,如有问题和想法请先到 Greasy Fork 反馈页面Github Issues 页面提交。

The script is not open for contribution for now. Please refer to the Greasy Fork feedback page or Github Issues in case of any problems or suggestions.

copyright 许可 License

GNU General Public License v3.0 or later

mailbox 邮箱 Email

zzwu@zju.edu.cn

heart 捐赠 Donation

支付宝 Alipay微信 Wechat