# Save PointCloud as Tiff

**URL:** <https://forum.commonvisionblox.com/t/save-pointcloud-as-tiff/992>\
**Category:** .Net API\
**Tags:** csharp\
**Created:** [December 18, 2019, 10:38am UTC](https://forum.commonvisionblox.com/t/save-pointcloud-as-tiff/992 "2019-12-18T10:38:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://forum.commonvisionblox.com/u/Michael)\
**Post date:** [December 18, 2019, 10:38am UTC](https://forum.commonvisionblox.com/t/save-pointcloud-as-tiff/992/1 "2019-12-18T10:38:37Z")

</div>

Hi,

I try to save my PointCloud as Tiff, which is working, if I save the Pointcloud as file and read it in again. If I use the object directly, I get a Tiff file, which cannot be opened.

Here is my code:

```auto
PointCloud cloud = Calibrator3D.FromFile($@"D:\VermessungErgebnisse\CalibrationFile.dat").CreatePointCloud(image, PointCloudFlags.Double);
var boundingBox = cloud.CalculateBoundingBox();
ValueRange<double> xRange = new ValueRange<double>(double.MinValue, double.MaxValue);
ValueRange<double> yRange = new ValueRange<double>(double.MinValue, double.MaxValue);
xRange.Min = boundingBox.X.Min;
xRange.Max = boundingBox.X.Max;
yRange.Min = boundingBox.Y.Min;
yRange.Max = boundingBox.Y.Max;
int targetWidth = image.Width;
int targetHeight = image.Height;
double bgValue = boundingBox.Z.Min;
cloud.ToRangeMap(xRange, yRange, targetWidth, targetHeight, gValue).Save($@"D:\VermessungErgebnisse\Test\notWorking.tiff");
cloud.Save($@"D:\VermessungErgebnisse\Test\test.xyz");
cloud = PointCloud.FromFile($@"D:\VermessungErgebnisse\Test\test.xyz");
cloud.ToRangeMap(xRange, yRange, targetWidth, targetHeight, bgValue).Save($@"D:\VermessungErgebnisse\Test\Working.tiff");
```

---

<div class="post-metadata">

**Author:** ![Moli](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/moli/32/553_2.png) [@Moli](https://forum.commonvisionblox.com/u/Moli)\
**Post date:** [December 19, 2019, 10:16am UTC](https://forum.commonvisionblox.com/t/save-pointcloud-as-tiff/992/2 "2019-12-19T10:16:22Z")

</div>

Hi Michael,

both ways must work. What exactly means that you cannot open the tiff file? Are you sure that the saving of the rectified range map has already worked?  
In your code I can see that you use different background values. Is that on purpose?

Best regards,  
Maurice
