Saving objects' coordinates as RGBA
If I understand correctly you would basically do
def locations_to_image(objects, image_name='Locations'):
    im = bpy.data.images.new(image_name, len(objects), 1)
    i = 0
    for ob in objects:
        im.pixels[i:i+3] = xyz_to_rgb(ob.matrix_world.translation)
        i += 4
    return im

def xyz_to_rgb(xyz):
    # Replace with however you want locations encoded.
    # This is just an example.
    bb_max = 50  # bounding box size
    return [(v + bb_max)/(2*bb_max) for v in xyz]

Edit to match your specifications.
PS. RGBA components are always in the range [0,1], so you'll need to encode them somehow.