Versions in this module Expand all Collapse all v1 v1.0.0 Jun 30, 2026 Changes in this version + const BetaVarianceCVThreshold + const CoeffRangeMax + const CoeffRangeMin + const DefaultBetaThreshold + const DefaultBlurEpsilon + const DefaultCropPixels + const DefaultReliableBetaFloor + const DoubleCompressionThreshold + const FrequencyBandMode12 + const FrequencyBandMode21 + const FrequencyBandMode22 + const MaxHistogramRange + const MaxImageDimension + const MaxImageSize + const MaxPixelCount + const MaxPlausibleF5Beta + const MaxQualityFactor + const MinImageSize + const MinQualityFactor + const NumLowFrequencyModes + const QualityDegradedMin + const QualityInsufficientMax + const QualityOptimalMax + const QualityOptimalMin + const QualityUnreliableMin + func ClampBeta(beta float64) float64 + func ClampConfidence(confidence float64) float64 + func ClampFloat64(v, minVal, maxVal float64) float64 + func ClampShrinkage(shrinkage float64) float64 + func CountNonZeroACCoefficients(coeffs []DCTCoefficient) (totalNonZero, totalAbsH1 int) + func DetectF5(imageData []byte) (detected bool, confidence float64, err error) + func FoldedCount(hist DCTHistogram, d int) int + func GetLogger() logger.Logger + func GetSupportedLocales() []string + func SetLogger(l logger.Logger) + func SetTranslator(translator TranslatorProvider) + func SqrtFloat64(v float64) float64 + func Subsampling(imageData []byte) (string, error) + type AnalysisResult struct + Beta float64 + Calibration *CalibrationResult + Confidence float64 + Inconclusive bool + InconclusiveReason string + IsClean bool + MessageLength *MessageLengthEstimate + PerModeBetas map[string]float64 + Quality int + QualityReliability QualityReliability + RawBeta float64 + Saturated bool + Signatures *SignatureReport + Verdict Verdict + Warnings []Warning + func Analyze(imageData []byte, opts ...Option) (result *AnalysisResult, err error) + func (r AnalysisResult) MarshalJSON() ([]byte, error) + type BetaEstimationResult struct + Beta float64 + BetaCV float64 + Confidence float64 + IsClean bool + MinBeta float64 + PerModeBetas map[string]float64 + PerModeRawBetas map[string]float64 + RawBeta float64 + Saturated bool + func (r BetaEstimationResult) MarshalJSON() ([]byte, error) + type BetaEstimator interface + EstimateBeta func(stegoHistograms, coverHistograms []DCTHistogram) (*BetaEstimationResult, error) + EstimateBetaForMode func(stegoHist, coverHist DCTHistogram) (beta, confidence float64, err error) + func NewBetaEstimator() BetaEstimator + func NewBetaEstimatorWithThreshold(threshold float64) BetaEstimator + type CalibrationResult struct + BestQuality int + CalibratedBeta float64 + Confidence float64 + IsDoubleCompressed bool + QualityDistances map[int]float64 + UncalibratedBeta float64 + func (c CalibrationResult) MarshalJSON() ([]byte, error) + type CoefficientExtractor interface + Extract func(data []byte) ([]DCTCoefficient, error) + func NewCoefficientExtractor() CoefficientExtractor + type DCTCoefficient struct + Col int + Component int + Row int + Value int16 + type DCTHistogram struct + Component int + Counts map[int]int + FrequencyBand int + type DCTMode string + const Mode12 + const Mode21 + const Mode22 + func AllModes() []DCTMode + func FrequencyBandToMode(band int) DCTMode + type Detection struct + Beta float64 + Confidence float64 + InconclusiveReason string + Verdict Verdict + Warnings []Warning + func Detect(imageData []byte) (detection *Detection, err error) + type Error struct + Cause error + Code ErrorCode + I18nKey string + Message string + func ErrApplyBlur(cause error) *Error + func ErrBetaOutOfRange() *Error + func ErrCoeffExtraction(cause error) *Error + func ErrConvertToRGB(cause error) *Error + func ErrConvertToYCbCr(cause error) *Error + func ErrCropImage(cause error) *Error + func ErrCropTooLarge(cropSize, width, height int) *Error + func ErrDecodeFailed(cause error) *Error + func ErrDecodeStegoImage(cause error) *Error + func ErrDimensionOverflow(width, height int) *Error + func ErrDimensionTooLarge(value int, dimension string, maxValue int) *Error + func ErrEmptyHistograms() *Error + func ErrEncoderQualityFailed(cause error) *Error + func ErrEncodingFailed(cause error) *Error + func ErrEstimateBeta(cause error) *Error + func ErrEstimateCoverHistogram(cause error) *Error + func ErrExtractCoverCoefficients(cause error) *Error + func ErrExtractStegoCoefficients(cause error) *Error + func ErrFinalQualityOutOfRange() *Error + func ErrImageEmpty() *Error + func ErrImageNil() *Error + func ErrImageTooLarge(size, maxSize int) *Error + func ErrImageTooSmall(size, minSize int) *Error + func ErrIntermediateCompress(cause error) *Error + func ErrIntermediateDecode(cause error) *Error + func ErrInvalidBetaValue() *Error + func ErrInvalidChannels(channels int) *Error + func ErrInvalidConfidence() *Error + func ErrInvalidDimensionsOrChannels() *Error + func ErrInvalidEpsilon(epsilon float64) *Error + func ErrInvalidImageDimensions() *Error + func ErrInvalidMessageLength() *Error + func ErrMatrixKOutOfRange() *Error + func ErrMissingEOI() *Error + func ErrMissingSOI() *Error + func ErrNegativeCropSize() *Error + func ErrNilEncoder() *Error + func ErrNilPixelData() *Error + func ErrNilRGBPixels() *Error + func ErrNilYCbCrPixels() *Error + func ErrNoQualityFactors() *Error + func ErrNotBaselineJPEG() *Error + func ErrPanicInAnalyze() *Error + func ErrPanicInDetectF5() *Error + func ErrPixelCountTooLarge(pixels, maxPixels int) *Error + func ErrPixelLengthMismatch(actual, expected, width, height int) *Error + func ErrProgressiveTranscode(cause error) *Error + func ErrQualityOutOfRange() *Error + func ErrRecompress(cause error) *Error + func ErrStegoQualityOutOfRange() *Error + func ErrTestQualityOutOfRange() *Error + func NewError(code ErrorCode, message string) *Error + func NewLocalizedError(code ErrorCode, i18nKey, defaultMsg string) *Error + func NewLocalizedErrorf(code ErrorCode, i18nKey, defaultMsg string, args ...interface{}) *Error + func WrapError(code ErrorCode, message string, cause error) *Error + func WrapLocalizedError(code ErrorCode, i18nKey, defaultMsg string, cause error) *Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorCode int + const ErrCalibrationFailed + const ErrEmptyHistogram + const ErrExtractionFailed + const ErrInvalidBeta + const ErrInvalidQuality + const ErrInvalidResult + const ErrPanicRecovered + const ErrValidationFailed + func (e ErrorCode) String() string + type HistogramCalibrator interface + CalculateL2Distance func(stegoHist, coverHist DCTHistogram, beta float64) (float64, error) + CalibrateWithMultipleQF func(stegoImage []byte, stegoQuality int, stegoHistograms []DCTHistogram, ...) (*CalibrationResult, error) + func NewHistogramCalibrator(codecInst JPEGCodec, imageProc ImageProcessor, ...) HistogramCalibrator + type HistogramEstimator interface + EstimateCoverHistogram func(stegoImage []byte) (stegoHistograms []DCTHistogram, coverHistograms []DCTHistogram, quality int, ...) + func NewHistogramEstimator(jpegCodec JPEGCodec, imageProc ImageProcessor, ...) HistogramEstimator + type ImageProcessor interface + ApplyBlur func(pixels []byte, width, height, channels int, epsilon float64) (blurredPixels []byte, err error) + ConvertToRGB func(ycbcrPixels []byte, width, height int) (rgbPixels []byte, err error) + ConvertToYCbCr func(rgbPixels []byte, width, height int) (ycbcrPixels []byte, err error) + CropImage func(pixels []byte, width, height, channels, cropSize int) (croppedPixels []byte, newWidth, newHeight int, err error) + func NewImageProcessor() ImageProcessor + type JPEGCodec interface + Decode func(data []byte) (pixels []byte, width, height int, err error) + Encode func(pixels []byte, width, height, quality int) (data []byte, err error) + IsBaseline func() bool + QualityFactor func() int + func NewJPEGCodec() JPEGCodec + type MatrixKCandidate struct + FitsCapacity bool + K int + MessageBits int + MessageBytes int + ModifiedCoefficients int + PayloadBits int + PayloadBytes int + SelfConsistent bool + type MessageLengthEstimate struct + BelowReliableFloor bool + Candidates []MatrixKCandidate + MatrixEmbeddingEfficiency float64 + MatrixEmbeddingK int + MessageBits int + MessageBytes int + ModificationRate float64 + ModifiedCoefficients int + PayloadBits int + PayloadBytes int + ReliableFloor float64 + ShrinkageProbability float64 + UsableCoefficients int + func (m MessageLengthEstimate) MarshalJSON() ([]byte, error) + type MessageLengthEstimator interface + CalculateMatrixEfficiency func(k int) (float64, error) + EstimateMessageLength func(beta float64, stegoHistograms, coverHistograms []DCTHistogram, matrixK int, ...) (*MessageLengthEstimate, error) + func NewMessageLengthEstimator() MessageLengthEstimator + type Option func(*analyzerConfig) + func WithAutoMatrixK() Option + func WithBackend(b HistogramEstimator) Option + func WithCoverBlurEpsilon(epsilon float64) Option + func WithCoverCrop(pixels int) Option + func WithLogger(l logger.Logger) Option + func WithMatrixK(k int) Option + func WithProgressiveSupport(enabled bool) Option + func WithQualityFactors(qualityFactors []int) Option + func WithSimpleBeta() Option + func WithThreshold(threshold float64) Option + type QualityReliability string + const ReliabilityDegraded + const ReliabilityInsufficient + const ReliabilityOptimal + const ReliabilityUnknown + const ReliabilityUnreliable + type Signature struct + Description string + Detail string + Matched bool + Name string + Weight float64 + type SignatureReport struct + Baseline bool + CarrierViable bool + Score float64 + Signatures []Signature + StandardQuality int + Subsampling string + func Signatures(imageData []byte) (*SignatureReport, error) + type Stream struct + In chan<- StreamRequest + Out <-chan StreamResult + func NewStream(ctx context.Context, workers int, opts ...Option) *Stream + type StreamRequest struct + ID string + Image []byte + type StreamResult struct + Err error + ID string + Result *AnalysisResult + type TranslatorProvider interface + GetLocale func() string + HasKey func(key string) bool + SetLocale func(locale string) + Translate func(key string) string + TranslateWithArgs func(key string, args ...interface{}) string + func GetTranslator() TranslatorProvider + func NewTranslator(locale string) (TranslatorProvider, error) + type Verdict string + const VerdictClean + const VerdictInconclusive + const VerdictStego + type Warning struct + Code WarningCode + Message string + type WarningCode string + const WarningAutoMatrixKNotConsistent + const WarningBetaImplausiblyHigh + const WarningBetaSaturated + const WarningDoubleCompression + const WarningHighBetaVariance + const WarningInconclusive + const WarningInsufficientCoefficients + const WarningLowBetaFloor + const WarningQualityHigh + const WarningQualityLow + const WarningQualityUnknown + const WarningQualityVeryLow