func TestDecodePBMEncodePPM(t *testing.T) {
	var w bytes.Buffer
	img := imageFromString(t, pbmRaw, PBM)
	opts := &EncodeOptions{Format: PPM}
	err := Encode(&w, img, opts)
	if err != nil {
		t.Fatal(err)
	}
}
TestDecodePBMEncodePPM confirms that a PBM file can be re-encoded as PPM.
package netpbm
import (
	"bytes"
	"compress/flate"
	"testing"
)
func TestNetpbmDecodePGMPPMOpts(t *testing.T) {
	r := flate.NewReader(bytes.NewBufferString(pgmRaw))
	defer r.Close()
	img, err := Decode(r, &DecodeOptions{
		Target: PPM,
		Exact:  false,
	})
	if err != nil {
		t.Fatal(err)
	}
	if img.Format() != PPM {
		t.Fatalf("Expected PPM but received %s", img.Format())
	}
}