Comments (16)
That's a really awesome idea!
But in this case, the problem is a bit different.
I just tried this:
var r = savePixels(pixels, options.format, {quality: 100});
...
That is, explicitly asking save-pixels to save in high quality.
After that, there was no deterioration as we can see above at all.
But that created a new problem. The build failed.
One unit test failed.
As you can see in the screenshot, the two values which tape says are "not equal" are actually equal.
I even tried equating them in JS. Still unequal. I assure you, they are equal. Because of this, I had to remove the {quality: 100}
parameter. And hence we are facing that issue.
from image-sequencer.
Why do you think the reason could be?
For two strings to be unequal but seem equal when printed?
Different encoding?
Or What could it possibly be? I am just out of thoughts :/
from image-sequencer.
from image-sequencer.
Sorry, this somehow skipped me. Thanks for your suggestion about the String()
but that didnt work. Based on StackOverflow answers, I have tried string.trim()
, that didn't work either.
Also, this works:
string1.substring(0,string1.length-25) == string2.substring(0,string2.length-25) //true
If 25 is replaced with any number less than 25, the above returns false.
These are the two strings:
(When I compare them on http://www.textdiff.com/ It says that there's nothing common in the two strings! It also shows similar results -- the '25' thing)
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIABAAEAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAA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dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APxfr/Kc/wC/gKACgAoA/wD/2Q==
from image-sequencer.
Aha! I looked really carefully -- the first string ends with:
APxnr/Kc/wC/gKACgAoA/wD/2Q==
The second ends with:
APxfr/Kc/wC/gKACgAoA/wD/2Q==
Notice: APxnr
vs. APxfr
-- !!
just one character off.
https://gist.github.com/jywarren/fdb5294effe01b908245700a38adc057/revisions
from image-sequencer.
If you re-encode again, does it stay APxfr
?
from image-sequencer.
Wow those are exceptionally great observation skills there, I must say!
from image-sequencer.
No, re-encoding doesn't change anything, I tried.
I think the method I am using for testing this isn't ideal.
I doubly-invert a DataURL and equate two DataURL strings.
I should probably use a different sort of comparison. Like one with a threshold.
I don't know why doubly inverting a DataURL would give a slightly different result when generated in High Quality. Do you know any articles which would help me identify which part of a DataURL/Image Binary contain what information
from image-sequencer.
from image-sequencer.
Thanks for the update! I will do that.
from image-sequencer.
The issue that we are facing, of the unequal DataURLs, could it be the result of the lossy JPEG compression?
from image-sequencer.
Turns out I am right! I converted that image to PNG and now it works! What should be done now? I still think that comparing with a threshold should should be implemented.
from image-sequencer.
from image-sequencer.
The module you mentioned npm:image-diff
is pretty heavy. I am not sure we should use it.
Maybe I can write a lightweight library for that myself.
from image-sequencer.
There were a few others, no? And we don't need to include it in the library itself; it could just be included in the test suite and under devDependencies
.
https://github.com/publiclab/image-sequencer/blob/master/CONTRIBUTING.md#module-candidates -- had several diff modules. I'd like to open this issue and take slow steps in this direction; not urgent!
from image-sequencer.
oops, ok -- #83!
from image-sequencer.
Related Issues (20)
- Adding an image sharpening module
- Removing scroll-to-top on mobile devices HOT 5
- Focus stacking module implementation HOT 1
- Halftone angle (in radians) needs to be a decimal instead of an integer HOT 3
- Dependencies Requiring Manual Upgrades HOT 1
- Remove Unused Dependencies HOT 1
- Supported NodeJS Versions HOT 3
- New module idea: ocr text recognition
- Use Modern JS HOT 2
- Can add units to the dimension of the image HOT 10
- How do I specify "executablePath" when calling Puppeteer HOT 5
- yarn.lock vs. package-lock.json HOT 1
- Checklist and coordination for v3.7.2 patch release and v3.7.3 follow-up patch release HOT 8
- Ideas for next release HOT 2
- Yarn complains about [email protected] expecting node 0.8.x HOT 13
- New module idea: descreen/dehalftone/inverse halftone
- Checklist and coordination for v3.8.0 minor release
- Incorrect local path for manipulation.wasm when using as an embedded library in MapKnitter.org
- eslint-error : Expected linebreaks to be 'LF' but found 'CLRF' HOT 1
- all thumbnails are not visible in the add step box HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-sequencer.