I am running this script to convert PNG to GTiff and tag it with coordinates and a crs of my choice. It works just fine but after the conversion the geotiff file is 177 MB (the png is 1 mb or smt) and it blocks me from working with the file. I am new to programming and i dont know where this is coming from. Below shown is the code which worked for me:
import rasterio
dataset = rasterio.open("input_file_path", 'r')
bands = [1,2,3]
data = dataset.read(bands)
transform = rasterio.transform.from_origin(9.171524, 53.057311, data.shape[1], data.shape[2])
crs = {'init': 'epsg:4326'}
with rasterio.open("output_file_path", 'w', driver='GTiff',
width=data.shape[2], height=data.shape[1],
count=3, dtype=data.dtype, nodata=0,
transform=transform, crs=crs) as dst:
dst.write(data, indexes=bands)