code: def spectrogram_to_db_uint(
      spectrogram: tf.Tensor, db_range: float = 100.0, **kwargs
  ) -> tf.Tensor:
      """
      Encodes given spectrogram into uint8 using decibel scale.
  
      Parameters:
          spectrogram (tf.Tensor):
              Spectrogram to be encoded as TF float tensor.
          db_range (float):
              Range in decibel for encoding.
  
      Returns:
          tf.Tensor:
              Encoded decibel spectrogram as `uint8` tensor.
      """
      db_spectrogram: tf.Tensor = gain_to_db(spectrogram)
      max_db_spectrogram: tf.Tensor = tf.reduce_max(db_spectrogram)
      int_db_spectrogram: tf.Tensor = tf.maximum(
          db_spectrogram, max_db_spectrogram - db_range
      )
      return from_float32_to_uint8(int_db_spectrogram, **kwargs)
  
file_path: spleeter/spleeter/audio/convertor.py
imports: import numpy
  import tensorflow
  from ..utils.tensor import from_float32_to_uint8, from_uint8_to_float32
label_desc: Use image node_id 5 for calling a global function with example usage: spectrogram_to_db_uint(spectrogram, db_range) and returns: from_float32_to_uint8