image-unblur-pixel-review 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/lib/image_unblur_pixel_review.rb +12 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 07b3c052c48c5a1e97c28973a796ab50a045cce179c3f56d3c2a7152f12a43ae
|
|
4
|
+
data.tar.gz: 580032059df09a34c9a255377433423f4d6d7d26e7db9d8071f50b90b3f4ef33
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: bb6ce7e781cdc2c942fb967a8e78e9e0e863aa78890635a47b24ab988c5bae8b28c905d9037edf06d6437e3c6d52a76e7bc98e120c20943b0dab94ae7e166f0c
|
|
7
|
+
data.tar.gz: 971c6246640a737b0bb695ca346cf923432dfa75b73d019800a9682ab772f02e0bd347f6d1ca04542d07b8fdbe05b34b28e67262c6c0625898227e5c880bae69
|
data/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Image Unblur Pixel Review
|
|
2
|
+
|
|
3
|
+
Measure changes between aligned original and restored image samples. Compare aligned before and after crops while checking text, faces and fine patterns against the original. A small or large pixel difference alone does not establish image fidelity.
|
|
4
|
+
|
|
5
|
+
For the related workflow, see [image unblur](https://imageunblur.ai/). This library is a local review helper; it does not upload data or perform conversion or enhancement.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Require `image_unblur_pixel_review` and call the documented module method with locally decoded data. Ruby 2.6 or later is required.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Measure changes between aligned original and restored image samples.
|
|
4
|
+
module ImageUnblurPixelReview
|
|
5
|
+
# Calculate mean absolute difference for equally sized 8-bit channel arrays.
|
|
6
|
+
# Align and decode the images before calling this method.
|
|
7
|
+
def self.mean_absolute_difference(original, restored)
|
|
8
|
+
raise ArgumentError, 'samples must be equal nonempty arrays' unless original.is_a?(Array) && restored.is_a?(Array) && !original.empty? && original.length == restored.length
|
|
9
|
+
raise ArgumentError, 'samples must contain 8-bit integers' unless (original + restored).all? { |v| v.is_a?(Integer) && v.between?(0, 255) }
|
|
10
|
+
original.zip(restored).sum { |a, b| (a - b).abs }.to_f / original.length
|
|
11
|
+
end
|
|
12
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: image-unblur-pixel-review
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Content True
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-12-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- README.md
|
|
20
|
+
- lib/image_unblur_pixel_review.rb
|
|
21
|
+
homepage: https://imageunblur.ai/
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.6'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubygems_version: 3.0.3.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: Measure changes between aligned original and restored image samples.
|
|
44
|
+
test_files: []
|