def filt_tracks_by_intensities (df_tracks, df_ints_by_track, int_type, bounds):
    """Filter tracks based on their intensities (both minimum and maximum).

    Args:
        df_tracks (Pandas dataframe): track data (can come from channel of
            either color)
        df_ints_by_track (Pandas dataframe): intensities by track (typically
            this would be the output of the compute_track_intensities function)
        int_type (string): column name in df_ints_by_track storing the
            intensity values will be used for track filtering
        bounds (tuple): lower and upper bounds of the intensities

    Returns:
        df_ints_filt (Pandas dataframe): filtered df_ints_by_track with only
            the desired tracks remaining.
        df_tracks_filt (Pandas dataframe): filtered df_tracks with only the
            desired tracks remaining.
    """
    ibt, it = df_ints_by_track, int_type
    df_ints_filt = ibt.loc[(ibt[it]>bounds[0]) & (ibt[it]<bounds[1])].copy()
    filt_IDs = df_ints_filt['track_ID'].unique()

    df_tracks_filt = df_tracks[df_tracks['track_ID'].isin(filt_IDs)].copy()

    return df_ints_filt, df_tracks_filt