code: def align8to32(bytes, width, mode):
      """
      converts each scanline of data from 8 bit to 32 bit aligned
      """
  
      bits_per_pixel = {"1": 1, "L": 8, "P": 8, "I;16": 16}[mode]
  
      # calculate bytes per line and the extra padding if needed
      bits_per_line = bits_per_pixel * width
      full_bytes_per_line, remaining_bits_per_line = divmod(
          bits_per_line, 8
      )
      bytes_per_line = full_bytes_per_line + (
          1 if remaining_bits_per_line else 0
      )
  
      extra_padding = -bytes_per_line % 4
  
      # already 32 bit aligned by luck
      if not extra_padding:
          return bytes
  
      new_data = []
      for i in range(len(bytes) // bytes_per_line):
          new_data.append(
              bytes[i * bytes_per_line : (i + 1) * bytes_per_line]
              + b"\x00" * extra_padding
          )
  
      return b"".join(new_data)
  
file_path: pillow-simd/src/PIL/ImageQt.py
imports: import sys
  from io import BytesIO
  from .None import Image
  from ._util import isPath
label_desc: Use image node_id 4 for calling a global function with example usage: align8to32(bytes, width, mode) and returns: bytes, bytes