API Snapshot quality is MUCH worse than Web Snapshots - blocky artifacts in shadows plus overall lightening

alekk

Pulling my weight
Joined
Aug 13, 2018
Messages
115
Reaction score
128
Location
Republic of Boulder
I setup my 2nd camera on a scene that has a wider dynamic range with varying colors with more controlled light ... and yea, for this scene, I can see more of a difference in quality between VBR and CBR ... albeit I "pay" for it with a much larger file size.

Better yet, it provides a good example of the "lightening of the image" - below are the actual images as pulled from via the web interface and the API. The noise/quality is comparable ... but the API generated JPEG is "lightened" in the shadows (with the highlights knocked down) which is most easily seen in the GIF generated from Photoshop showing the difference.


Web-v-API-inside.gif


20240105_062704.png


API.jpeg
 
Last edited:

duplo

Getting comfortable
Joined
May 26, 2022
Messages
301
Reaction score
376
Location
Berlin, Deutschland
You will notice a difference between VBR/CBR and bitrate when there is movement.
On still image the difference will be less to zero visible.

Not sure what your aim of these pictures is, but in my opinion its ridiculous complaining about that.
In reality the colors on both pictures look awful for me. Color corrections etc can be done easily with any photo software if need one of these pictures for something important.
 

alekk

Pulling my weight
Joined
Aug 13, 2018
Messages
115
Reaction score
128
Location
Republic of Boulder
I agree the color balance is bad in the "house" pictures. What I'm highlighting is the difference between the PNG from the web interface and the JPEG from the API.
Here's the histograms of those two pictures from Photoshop - note the compression of the dynamic range by boosting the shadows and knocking down the highlights.

Histogram-WebPNG-vs-APIJPEG.gif



Histogram-WebPNG-vs-APIJPEG.jpg
 

alekk

Pulling my weight
Joined
Aug 13, 2018
Messages
115
Reaction score
128
Location
Republic of Boulder
So as demonstrated above in the histograms, the JPEG generated from the API has a compressed dynamic range by boosting the shadows and knocking down the highlights. I also pointed out earlier that Hikvision has a Grey Scale option (Image->Image Enhancement) where you can choose the grey scale range as [0-255] or [16-235] ... I'm now pretty certain is the Dahua is doing [16-235] when it generates JPEG's via the API.

I don't know why I didn't think of this earlier, but it was trivial to open the PNG in Photoshop (which has RGB values from 0-255) and simply change the Output Levels to 16-235 ... and BOOM ... that JPEG looks a LOT like the one generated from the API - see GIF below.

Obviously this "flattening" of the image (and loss of contrast) doesn't look as good ... and I can't imagine any reason to not use all of the RGB values from 0-255.

I suspect the internal algorithms are doing something goofy in the Color Space - maybe using YCbCr?
Regardless, is there any way to change that? I didn't see any color space options nor a "grey scale" (as with the Hikvision) to change via the web interface or in the Encode.Snapformat settings.


Web-v-Web16-235-v-API-inside.gif
 
Last edited:
Top