-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues With ImageManipulation.js #25
Comments
Update: Been working on it for the past two days. The same code used to work flawlessly on Browsers. Also, the DataURL is corrupted it seems. The latest commit is on PR #24 |
First, let me say it's really cool to be seeing image processing before/after images, even if there is a problem. We should put such examples into the README as it really brings the project to life! To be clear, are you saying that it does work in browsers, but not in node, or that it used to work in browsers, and now works in neither? Second, here's the link to the Here's the source: https://github.com/scijs/save-pixels/blob/master/save-pixels.js, and it has a test suite here: https://github.com/scijs/save-pixels/blob/master/test/test.js Is the saturation issue reproducible using just the My instincts are:
|
One odd thing is that the larger images don't seem as affected by the cutoff issue. I'd have guessed that this was due to running out of memory or something, but i'm interested in whether the cutoff with transparent pixels happens the same way each time, or if it's gets a different amount through the image each time. This would tell us if it's a consistent baked-in limitation or if it's some other issue. |
Also - where's the code for DoNothing? can you link that too? |
Hey @jywarren Thanks for the debugging ideas. Will look into them later today. Clarification: The save-pixels thing did work on browsers earlier. Earlier I did get the same once issue but i really don't remember how I fixed that. As of now, due to lack of a proper UI, testing this on a browser is really tedious. That is due to the fact that we can not access user files due to browser limitations, unlike node.js. So the user must enter a file via the HTML File Input. Since I was focusing on the functionality, I left out the the UI part as of now. So all I know is that we don't get any problems on the browser one (the one in ./index.html) No disappearing pixels, no saturation issues. This is an older browserified version, though. The Code for the DoNothing module is in PR #24 |
Update: The issue of incomplete pixels occurs only with PNG images and not with JPEG images. |
Wow, fascinating actually. It's almost certainly an issue with read or save
pixels! Do those libs depend on another module to read or encode?
…On Jun 9, 2017 11:19 PM, "Chinmay Pandhare" ***@***.***> wrote:
Update: The issue of incomplete pixels occurs only with PNG images and not
with JPEG images
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJwD0U3fdxjowWxrck53oWDraizJVks5sCgspgaJpZM4NvQ_K>
.
|
Two possible hints, one is that you can run the image selection using a
data URL -- that way you don't need to use the image select -- and also you
should be able to use phantomjs to test it in the browser but from the
command line.
It sounds like either way we should have jpgs and pngs in our tests. I
recommend filing this in the save pixels project repo and moving ahead with
jpeg for now.
I'd like to see one of the diff modules used in a test to compare a known
input to a known output.
You could start by doing a null operation on an image and using a diff
module to verify that it's identical, which should work for jpegs but not
pngs. But you can comment out the PNG test until that issue is resolved.
Good work!
…On Jun 9, 2017 11:38 PM, "Jeffrey Warren" ***@***.***> wrote:
Wow, fascinating actually. It's almost certainly an issue with read or
save pixels! Do those libs depend on another module to read or encode?
On Jun 9, 2017 11:19 PM, "Chinmay Pandhare" ***@***.***>
wrote:
> Update: The issue of incomplete pixels occurs only with PNG images and
> not with JPEG images
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#25 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AABfJwD0U3fdxjowWxrck53oWDraizJVks5sCgspgaJpZM4NvQ_K>
> .
>
|
Hey Jeff, Thanks a lot for your inputs! I was pondering over some things. Pretty mind-boggling results. Some TestsTest 1 : Creating a PNG DataURL From PNG Image (The DataURL is corrupted, image is desaturated)
Test 2 : Creating a binary PNG File from PNG Image (The Image is desaturated but COMPLETE)
Test 3 : Creating a JPEG DataURL from PNG Image (The DataURL is not corrupted, Image desaturated)
Known Test 4 : Works flawlessly on browsers. No desaturation or loss of image dataTest 5 : Comparison of JPEG DataURLs generated by The 'urify' npm module I am using to make initial DataURLs from an input image and the ones generated by get-pixels & save-pixelsThere is a module, This is my module stack [
A=B and C=D but B is not equal to C Conclusions
Further StepsI believe that what we are doing as
In the Could you please pull the development branch from Some Doubts (Concerns/Follow-ups)
Yes, you are right. It doesn't desaturate further.
How can I verify this?
I actually tested an image with a 100x100 red square in JPEG format. Couldn't see any noticeable change unlike the red in the before-after example shown above. (I would like to admit here that I did not check the RGB Values, Sorry for that.) |
Hi, just so I can go through this methodically:
Can you tell me exactly what to try out?
I think that's possible -- but we need to more narrowly test the issue. I'd like to suggest you debug this by console.logging the string result and/or doing a comparison somehow if you think that's the problem. Do you suspect this because of something you read? Or (as I do) do you think it's possible that since it's a stream, it expects to run continuously, and by using Maybe the best way to approach this is to encapsulate the narrow portion we suspect in a separate method, and to unit test that method with actual jpg and png data to try to (with automated tests) confirm what's going wrong. In general, I'd love to try to And above:
My suggestion for looking for a 3x difference or something like that in the RGB values was an attempt at this. Can we narrow the error any more? Does it affect red only, or other colors? Can you run a test image with pure RGB through it? Something like these: https://duckduckgo.com/?q=calibration+images&atb=v62-4&ia=images And then you could upload the before/after images here -- http://www.imagecolorpicker.com/ and see if the values are different by a round factor. But this is just a guess. Finally, you could also try to post a narrow description of this error (linking back to here for full context) to StackOverflow -- a pretty good idea, i think -- and also ask your fellow students and mentors to help you brainstorm a bit... @publiclab/reviewers -- any ideas here? |
Did this make sense? Keep us updated -- don't want you to get stuck and frustrated! Were you able to post to StackOverflow? |
Yes, @jywarren thanks for your help! I will surely take action upon all that you have suggested and revert to you. |
No, that's a really good strategy when you get stuck. Thanks for the
report-back!
…On Wed, Jun 14, 2017 at 11:07 AM, Chinmay Pandhare ***@***.*** > wrote:
Yes, @jywarren <https://github.com/jywarren> thanks for your help!
The issue is certainly surprising. I am having a look.
Was engaged with the Phase-1 completion of the Image Sequencer, as you
might have seen.
As soon as I am done with some small bugfixes and minor jobs with that, I
will focus on this.
Was too saturated, so shifted my focus for a while! Hope you don't mind.
I will surely take action upon all that you have suggested and revert to
you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ1rpmMZp-nVU-vJE5BBn79AnFDGoks5sD_c_gaJpZM4NvQ_K>
.
|
I opened up an issue on the
|
Yes but you could do both and link them together, since parts of the
question are general and parts are specific to save-pixels. Or at least
thats our theory.
…On Jun 18, 2017 3:53 AM, "Chinmay Pandhare" ***@***.***> wrote:
I opened up an issue <scijs/save-pixels#22>
with the save-pixels GitHub repository. Hope that would help a bit and
we'll also get some insight on these issuees:
- Is toString() the right way to produce the DatURI
- Why is there a desaturation happening?
I thought this would be better than opening a question on StackOverflow as
it would get noticed easily and by the right people. Am I right in saying
so?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ8ztqleJ9M_EHjCMC2ydAvxqESbwks5sFNdfgaJpZM4NvQ_K>
.
|
Hi, can you open up a StackOverflow issue too and link it from here? Thanks! |
I made the StackOverflow Issue. Here's the link. |
OK -- let's move forward with other tasks while we wait for a response. I can do some additional testing and outreach to find a solution if we don't get anything in a few days. |
Perhaps you should change the title on SO to include "red channel desaturated and/or cut off" and "using save-pixels" -- there's an art to a well-written issue title, and I think it'll get better input. :-) |
Done that! Thanks :) |
Guess what? I've found the problem with this!
and not
|
Now I feel like a fool. |
@ccpandhare it happens to the best of us. I am glad you found the solution to this :) |
No fooling :-) -- I'm so glad to hear you figured it out! Honestly must
feel great to have the solution, congrats!
…On Wed, Jun 28, 2017 at 8:51 AM, Ujjwal Sharma ***@***.***> wrote:
@ccpandhare <https://github.com/ccpandhare> it happens to the best of us.
I am glad you found the solution to this :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ4V18SgKv3IB6XUs5nRD8nIyQm2Dks5sIkw4gaJpZM4NvQ_K>
.
|
Let's get some of these issues closed up now! Things are getting exciting :-) Be sure to update your StackOverflow and other issues with the solution! |
Thanks a lot for the motivation @jywarren and @ryzokuken! I really appreciate that! Yes, I'll write an answer to the SO question and GitHub issue at the earliest. Thanks. |
@jywarren you could remove the bounty for this issue now :-) |
I'm not sure I can unless I solve it myself. If you solve it you can have
the bounty and if you like you can repost it on another issue you have.
…On Jun 28, 2017 11:34 AM, "Chinmay Pandhare" ***@***.***> wrote:
@jywarren <https://github.com/jywarren> you could remove the bounty for
this issue now :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ2Fu9oOu6bbWSx9GtOyh3lfyjYnnks5sInJugaJpZM4NvQ_K>
.
|
So should I do that? Is it okay? |
Fine with me, it was from personal funds and I'd love to see it reapplied
to a new problem!
…On Jun 28, 2017 11:43 AM, "Chinmay Pandhare" ***@***.***> wrote:
So should I do that? Is it okay?
Not sure about that...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ_5UDyJUUl-qbeClFVQfXTc2EZ8qks5sInSbgaJpZM4NvQ_K>
.
|
Woah, Okay! Thanks! |
There is some problem with the
savePixels
part of theImageManipulation.js
with all images.Some pixels don't get saved and also the saturation of the image, somehow, decreases.
Before:
After:
In fact, the "After" image is corrupted, those at the bottom are empty pixels and not white pixels.
The module used with
ImageManipulation.js
wasDoNothingPix.js
. This module just includesImageManipulation.js
without changing any pixels. This module was made specifically for this purpose.I believe the number of empty pixels isn't proportional to image size. This is because larger images have smaller area of "empty" pixels. For example:
Before:
After:
One might be tempted to think that the "After" image of Sundar Pichai is perfectly fine, but upon close inspection, it comes out that there is a thin strip of empty pixels at the bottom, and also, the image is slightly desaturated.
Maybe this is a flaw with
save-pixels
module (the desaturation part).We are surely missing something due to which we are gettng the blank strip of pixels.
The text was updated successfully, but these errors were encountered: