[gs-devel] How to tell when DCTEncode is OK? (re #450663)
Ray Johnston
ray at artifex.com
Wed Apr 10 00:09:40 PDT 2002
Peter,
Some of the article at http://www.faqs.org/faqs/jpeg-faq/part1/section-3.html
sums up what I would categorize as a good criteria (not an algorithm)
for selecting candidates for DCTEncode -- at least 4 bits per primary
(I wouldn't think that 8-bits per pixel of RGB is good enough since this
is 3 or less bits per primary) and "no sharp edges" (since these are what
DCT is worst at).
I presume you are looking for an image analysis algorithm that would
operate on a fully or at least substantially buffered image. Since the
DCT does poorly on high spatial frequency spatial, a transform that
yields the high frequency 'signature' of the image should suffice.
The 'brute force' approach is to do a FFT (or Cosine Transform) and
decide on the basis of the amplitude of the high frequencies. Noise,
while a high frequency contributor, is of low amplitude compared
with a sharp edge. A more efficient implementation would only do
the relevant part of the processing. A simple pixel differencing
transform would extract 'edge' features -- edges with a high
amplitude would classify the image as unsuitable for DCT. A pixel
differencing should have a 'gamma' applied before differencing
since any 'feathering' or 'ringing' artifacts in a white area are
much more visible and objectionable than the same amount of
effect in saturated areas.
I'll look some more through some info on image analysis to see
if there is any 'drop in' algorithm that seems suitable. I may
even have some code laying around from previous endeavors.
I'm curious to see what else comes in as response to your query.
Regards,
Ray
________________________________________________________________
"L. Peter Deutsch" wrote:
>
> I want to implement a reasonable algorithm for deciding when it's safe to
> compress an image with DCTEncode. (Only 8-bit-per-sample images are
> candidates.) Does anyone know a good one? I'm sure this topic has been
> investigated extensively, but I don't know where to look for the answers.
>
> --
>
> L. Peter Deutsch | Aladdin Enterprises | 203 Santa Margarita Ave.
> ghost at aladdin.com | http://www.aladdin.com | Menlo Park, CA 94025
>
> No government censorship of software! Oppose the CBDTPA! www.eff.org
> _______________________________________________
> gs-devel mailing list
> gs-devel at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
More information about the gs-devel
mailing list