Questions tagged [bit-depth]
70 questions
27
votes
4 answers
Color banding and artifacts with gradients despite using RGBA_8888 everywhere
I'm aware that colour banding is an old chestnut of a problem that has been discussed many times before with various solutions provided (which essentially boil down to use 32-bit throughout, or use dithering). In fact not so long ago I asked and…

Trevor
- 10,903
- 5
- 61
- 84
18
votes
1 answer
What is a channel in a .wav file format?Do all channels play simultaneaously when a wav file is played?
I read about.wav file format by googling,all I could figure was that Frames are made of samples(of some defined bit depth) and a wav stereo file has a multiple of something called channels....
The confusion is whether a channel is made up of…

Soul Enrapturer
- 367
- 2
- 3
- 14
9
votes
1 answer
LG G watch not displaying 32-bit Images or Gradients with full color depth
I've been struggling to get gradients to appear smooth on my LG G Watch running Android 5.0.1.
Before you mark as a duplicate, I have tried every answer for several posts (like Why android lose image quality when displaying a png file?, Is it…

Jason
- 13,563
- 15
- 74
- 125
9
votes
2 answers
How can I check the color depth of a Bitmap?
I'm working on an application that prints a folder of image files, including JPEG and TIFF. The TIFF images are usually Black and White (1bpp).
After loading the image, I want to determine if the image is Color or B&W or Grayscale so I can send the…

Chris Thompson
- 16,203
- 9
- 45
- 62
7
votes
1 answer
how to use sox to compress mp3?
I'd like to reduce the file size of some mp3 audios with sox. I think I can reduce stereo to only 1 channel (i.e. mono), reduce the sample rate and reduce the bit-depth. I find it seems sox can do none of that. Is this true or did I have done it…

RNA
- 146,987
- 15
- 52
- 70
7
votes
3 answers
How to convert int32 numpy array into int16 numpy array?
I want to conert a numpy array from int32 type to int16 type.
I have an int32 array called array_int32 and I am converting that to int16.
import numpy as np
array_int32 = np.array([31784960, 69074944, 165871616])`
array_int16 =…
user8026974
6
votes
3 answers
Determining Bit-Depth of a wav file
I am looking for a fast, preferably standard library mechanism to determine the bit-depth of wav file e.g. '16-bit' or '24-bit'.
I am using a subprocess call to Sox to get a plethora of audio metadata but a subprocess call is very slow and the only…

user3535074
- 1,268
- 8
- 26
- 48
6
votes
1 answer
Changing the bit-depth of figures produced using Matplotlib
I'm using matplotlib to generate some figures via savefig. These figures are black and white and need to be saved at a very high resolution (1000 dpi) in TIFF format. It would therefore be beneficial to save them with a reduced bit depth so as to…

sircolinton
- 6,536
- 3
- 21
- 19
6
votes
2 answers
Reduce bit-depth of PNG files from the command line
What command or series of commands could I execute from the CLI to recursively traverse a directory tree and reduce the bit-depth of all PNG files within that tree from 24bpp to 16bpp? Commands should preserve the alpha layer and should not increase…

teabot
- 15,358
- 11
- 64
- 79
5
votes
1 answer
Using ffmpeg or ffprobe to get the pixel bit depth of a video
Is it possible to use ffprobe or ffmpeg to figure out the bit depth of a video file? I specifically want to know how many bits per channel (bpc) my video is. 8 is typical, but some fancier codecs can use higher bit depths, and I'm not sure how to…

joejoejoejoe4
- 1,206
- 1
- 18
- 38
5
votes
1 answer
Does CGImage support 16 bits per channel?
bitsPerComponent says it's at most 8, but a couple of Stack Overflow questions imply 16 is supported.

Kartick Vaddadi
- 4,818
- 6
- 39
- 55
4
votes
2 answers
How to PHP get bit depth of a given PNG image file?
In PHP code, given an .png image path, I need to detect the bit-depth of that image. How can I do that?
I've tried to use getImageSize() and read the bits as below sample code but it always returns '8' for 24-bits/32-bits image.
Please help.
class…

Nam G VU
- 33,193
- 69
- 233
- 372
4
votes
0 answers
How to export 16-bit HEIF images in Swift?
I am trying to write an export function for my app that allows 16-bit depth HEIF files. Apple's documentation doesn't specify whether 16-bit is supported nor if the writeHEIFRepresentation() method requires any specific option for that. I have been…

AndreG
- 1,948
- 1
- 9
- 13
4
votes
0 answers
Get color depth of a Bitmap
I want to get the bit depth (and color space) of an image file with c#.
Here are my testfiles. Using the properties of the windows explorer, I verified their bit depths (8, 16, 24, 48, 96).
BitmapImage.Format.BitsPerPixel
var source = new…

Leander
- 508
- 6
- 21
3
votes
0 answers
How can I get the bit depth/sample rate of audio JS?
I need to get the Sample Rate of Audio file, loaded by standard input element.
I tried to use this function
function func(e) {
let reader = new FileReader();
reader.readAsArrayBuffer(e.files[0]);
reader.onload = function(event) {
…

Vera
- 51
- 1
- 6