def _adjust_component (n: int) -> int:
    """ Author: Bardia Parmoun
    Type Annotations: int -> int

    This function takes the integer values of r, g, and b and determines the 
    range in which these values are located and returns the midpoint of that 
    range. This function is used for the posterize filter. The possible ranges 
    and their midpoints are: (The functions argument MUST be in range of 
    0<=x<=255).
    
    0 to 63 -> 31 
    64 to 127 -> 95
    128 to 191 -> 159
    192 to 255 -> 223
    
    >>> _adjust_component (12)
    31
    >>> _adjust_component (156)
    159
    """
    
    #Constants
    RANGE1_LOW = 0
    RANGE1_MID = 31
    RANGE2_LOW = 64
    RANGE2_MID = 95
    RANGE3_LOW = 128
    RANGE3_MID = 159
    RANGE4_LOW = 192
    RANGE4_MID = 223
    
    # Checks to see what range is n located in and returns the midpoint of that
    # Range. 
    if n >= RANGE4_LOW:
        return RANGE4_MID
    elif n >= RANGE3_LOW:
        return RANGE3_MID
    elif n >= RANGE2_LOW:
        return RANGE2_MID
    else:
        return RANGE1_MID