C# のバックグラウンド タスクで、DynamicImage ライブラリの Tim Jones のフォークを使用しています。
レイヤー効果を分離することを除いて、すべてがうまく機能します. 以下の例では、「firstLayer」のフィルターが「secondLayer」にも適用されます。2 番目のレイヤーが一番上にある必要がありますが、一番下にのみ固定されています。どちらの画像も PNG で、「secondLayer」のみが透明です。フィルターが他のレイヤーに影響を与えないようにするにはどうすればよいですか?
Composition composition = new Composition();
//Create Layer 1 --------------
var firstLayer = LayerBuilder.Image.SourceBytes(firstImageBytes);
//Rotate The Image
firstLayer.WithFilter(FilterBuilder.Rotate.To(180));
//Crop the image
firstLayer.WithFilter(FilterBuilder.Crop.X(50).Y(50));
//Create Layer 2 -----------
var secondLayer = LayerBuilder.Image.SourceBytes(secondImageBytes);
//Add both layers to the composition ---------------
composition.Layers.Add(firstLayer.ToLayer());
composition.Layers.Add(secondLayer.ToLayer());
// Anchor image 2 to the bottom
composition.Layers[1].Anchor = AnchorStyles.BottomCenter;
//Generate The Image
GeneratedImage generatedImage = composition.GenerateImage();
//I then convert the generatedImage to a byte[] and save it to Blob storage.
上記のコードで多くのバリエーションを試しましたが、フィルターは適用されていないレイヤーに常に影響しているようです。私は重要な概念を見逃していると確信しています。何か考えや提案はありますか?