A method performed by a computing system comprising one or more processors and storage media, the method comprising: obtaining compressed image data that is a coded representation of a digital image; decoding the compressed image data to obtain at least one block of quantized discrete cosine transform coefficients representing a sample block of the digital image, the block of quantized DCT coefficients comprising a quantized DC coefficient and a plurality of quantized non-zero AC coefficients; determining probability estimates for binary symbols of binarized representations of the plurality of AC coefficients based, at least in part, on classifying each AC coefficient of the plurality of AC coefficients as being part of one of: (a) a top-edge row of AC coefficients of the block of DCT coefficients, (b) a left-edge column of AC coefficients of the block of DCT coefficients, or (c) a sub-block of AC coefficients of the block of DCT coefficients; wherein a particular AC coefficient of the plurality of AC coefficients is classified as being part of (c) the sub-block of AC coefficients, said determining probability estimates for binary symbols of a binarized representation of the particular AC coefficient is based on predicting the bits of the binarized representation of said particular coefficient based on: an AC coefficient at a same position in a quantized DCT block of coefficients above the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, an AC coefficient at a same position in a quantized DCT block of coefficients left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, and an AC coefficient at a. same position In a quantized DCT block of coefficients above and left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients; arithmetic coding the binary symbols based, at least in part, on the probability estimates; and based, at least in part, on the arithmetic coding, storing further compressed image data that is a coded representation of the digital image, the further compressed image data being lossless with respect to the compressed image data, the further compressed image data requiring fewer bytes to store in storage media than required by the compressed image data. obtaining compressed image data that is a coded representation of a digital image; decoding the compressed image data to obtain at least one block of quantized discrete cosine transform coefficients representing a sample block of the digital image, the block of quantized DCT coefficients comprising a quantized DC coefficient and a plurality of quantized non-zero AC coefficients; determining probability estimates for binary symbols of binarized representations of the plurality of AC coefficients based, at least in part, on classifying each AC coefficient of the plurality of AC coefficients as being part of one of: (a) a top-edge row of AC coefficients of the block of DCT coefficients, (b) a left-edge column of AC coefficients of the block of DCT coefficients, or (c) a sub-block of AC coefficients of the block of DCT coefficients; wherein a particular AC coefficient of the plurality of AC coefficients is classified as being part of (c) the sub-block of AC coefficients, said determining probability estimates for binary symbols of a binarized representation of the particular AC coefficient is based on predicting the bits of the binarized representation of said particular coefficient based on: an AC coefficient at a same position in a quantized DCT block of coefficients above the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, an AC coefficient at a same position in a quantized DCT block of coefficients left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, and an AC coefficient at a. same position In a quantized DCT block of coefficients above and left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients; an AC coefficient at a same position in a quantized DCT block of coefficients above the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, an AC coefficient at a same position in a quantized DCT block of coefficients left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients, and an AC coefficient at a. same position In a quantized DCT block of coefficients above and left of the block of DCT coefficients as a position of the particular AC coefficient in the block of DCT coefficients; arithmetic coding the binary symbols based, at least in part, on the probability estimates; and based, at least in part, on the arithmetic coding, storing further compressed image data that is a coded representation of the digital image, the further compressed image data being lossless with respect to the compressed image data, the further compressed image data requiring fewer bytes to store in storage media than required by the compressed image data.