/// <summary>
 /// Appends a tiff image into the tiff object
 /// </summary>
 /// <param name="img">Tiff image to append</param>
 public void Append(TiffImage tifimg)
 {
     foreach (Bitmap bmpimg in tifimg._imgs)
     {
         _imgs.Add(bmpimg);
     }
 }
        //remove image
        public static void RemovePage(int page, string dir)
        {
            TiffImage i;

            using (var fs = new FileStream(dir, FileMode.Open))
            {
                var ms = new MemoryStream();
                fs.CopyTo(ms);
                i = new TiffImage(ms);
                i._imgs.RemoveAt(page - 1);
            }
            if (i._imgs.Count == 0)
            {
                File.Delete(dir);
            }
            else
            {
                i.Save(dir);
            }
        }
        void AppendBack(TiffImage tifimg, int index = -1)
        {
            List <Bitmap> __imgs = new List <Bitmap>(tifimg._imgs);


            if (index == -1 || index > _imgs.Count)
            {
                foreach (Bitmap bmpimg in _imgs)
                {
                    __imgs.Add(bmpimg);
                }
                _imgs = __imgs;
            }
            else if (index < _imgs.Count)
            {
                foreach (Bitmap bmpimg in _imgs)
                {
                    __imgs.Insert(index++, bmpimg);
                }
                _imgs = __imgs;
            }
        }