画像にテキストを追加する@lwx228尋ねた画像が読み込まれたセルにテキストを追加するにはどうすればよいですか?このアイデアは非常にシンプルです。フレーム ボックスに画像を配置し、グラフィック スクリプトを使用して装飾し、新しい画像を撮影します。 素敵な往復画像を取得するための詳細は、もう少し複雑です。 フレームのサイズと縮尺を調整し、画像を配置して、最終的な画像をトリミングする必要があります。
// open the original
original = New Image(
"https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Oroblanco_%28sweetie%29_fruits.jpg/320px-Oroblanco_%28sweetie%29_fruits.jpg"
);
{xSize, ySize} = original << size;
// use a frame to do the drawing, make the original fit the frame exactly
gb = Graph Box(
<<BACKGROUNDCOLOR></BACKGROUNDCOLOR>
以下の結果は、フレーム ボックスを装飾で満たした画像と、その下の 3 つの画像を示しています。 左がオリジナル、中央が修正、右が差分です。 違いはほとんど黒で、変化はありません。これは良いことです。 アンチエイリアシングがテキストの端に微妙な変更を加えたため、違いのテキストはぼやけています。
Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.Circles and text added on top of fruit picture.果物の写真の上に追加された円とテキスト。
からの写真JPG 画像のトリミング作物がどのように機能するかを説明します。
もっと見る...
Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.Use a graphics frame box to add text and lines on top of a picture.グラフィック フレーム ボックスを使用して、画像の上にテキストと線を追加します。
フレーム ボックスを使用して、画像にテキストや線を追加します。
Re: 写真にテキストを追加するわかった
クレイジありがとう!
gb[framebox(1)]<<ADD image=""></ADD>
Re: 画像に文字を追加するはい。少し難しくなりますので、以下で説明します。
// open the original
original = New Image(
"https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Oroblanco_%28sweetie%29_fruits.jpg/320px-Oroblanco_%28sweetie%29_fruits.jpg"
);
{xSize, ySize} = original << size;
overlay1 = new image("https://us.v-cdn.net/6038925/uploads/images/35680iA0171FFF13D53E06/NaturalCat.png");// cat
{xOverlay1Size, yOverlay1Size} = overlay1 << size;
dt = open("$sample_data/big class families.jmp","invisible");
overlay2 = dt:picture[1];// katie
overlay2<<SCALE></SCALE>
<P> </P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pictures added over another picture." style="width: 971px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Pictures added over another picture." style="width: 971px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Pictures added over another picture." style="width: 971px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Pictures added over another picture." style="width: 971px;"><span class="lia-inline-image-display-wrapper" image-alt="Pictures added over another picture." style="width: 971px;"><img src="https://us.v-cdn.net/6038925/uploads/images/43745i912405FE3CFBC3E8/PicturePlusPicture.png" role="button" title="PicturePlusPicture.png" alt="Pictures added over another picture." /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Pictures added over another picture.</span></span><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Pictures added over another picture.</SPAN></SPAN><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Pictures added over another picture.</SPAN></SPAN><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Pictures added over another picture.</SPAN></SPAN><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">別の写真の上に写真を追加しました。</SPAN></SPAN></P>
<P>グラフィック スクリプトでは画像を追加できません。 < を使用します。 <ADDIMAGE message="" instead.=""><></ADDIMAGE></P><P> </P>
<P>GraphBox(...) 関数は、パラメーター、メッセージ、スクリプトの 3 種類の引数を受け取ります。ベスト プラクティスは、パラメータとメッセージを最初に配置し、単一のスクリプトを最後に配置することです。パラメータとメッセージはカンマで区切られます。スクリプトではステートメントを区切るためにセミコロンを使用します。</P>
<P> </P>
<CODE class=" language-jsl">gb = Graph Box(
<<BACKGROUNDCOLOR></BACKGROUNDCOLOR>
<P> </P>
<P>非常に多くのグラフ ボックス スクリプトは、セミコロンではなく誤ってコンマを使用して書かれています。各カンマにより、前のスクリプトから分離された新しいスクリプトが開始されます。複数のスクリプトを実行する場合、JMP が複数のスクリプトを実行すると、少し余分なオーバーヘッドが発生します。</P>
<P> </P>Re: 写真にテキストを追加するこんにちはクレイジ!
JSLは画像の指定位置に小さな画像を重ねることができるのだろうか?
ヘルプマニュアルを検索しましたが、答えが見つかりませんでした。
それが私が考えることができるすべてです。専門家に感謝します!
img = Open( "$SAMPLE_IMAGES/tile.jpg", jpg );
{x, y} = img << size;
img << crop( Left( 100 ), Right( x - 251 ), top( 0 ), bottom( y - 0 ) );
{x1, y1} = img << size;
img2 = Open( "$SAMPLE_IMAGES/black rhino footprint.jpg", jpg );
img << copy;//??
img2 << paste(100,25);//??
obj = New Window( "paste", New Image( img2 ) );<BR />
回复: 画像にテキストを追加するポートレートの透明度を 50% などに上げるにはどうすればよいですか?
ありがとう専門家!
Re: 写真にテキストを追加する良い質問。 12~18行目参照
Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie is now 50% transparent.Katie の透明度は 50% になりました。
// open the original
original = New Image(
"https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Oroblanco_%28sweetie%29_fruits.jpg/320px-Oroblanco_%28sweetie%29_fruits.jpg"
);
{xSize, ySize} = original << size;
overlay1 = new image("https://us.v-cdn.net/6038925/uploads/images/35680iA0171FFF13D53E06/NaturalCat.png");// cat
{xOverlay1Size, yOverlay1Size} = overlay1 << size;
dt = open("$sample_data/big class families.jmp","invisible");
overlay2 = dt:picture[1];// katie
// adjusting transparency. Katie already has a transparent background, alpha=0, and a mostly opaque
// foreground, alpha=1. Katie probably has some antialiasing around the edge of the shape, 0 < alpha < 1.
// rather than set all the alpha for the entire square to .5, multiply the existing alpha by .5.
// this will leave the alpha=0 at 0, and modify the others...
{r,g,b,a} = overlay2<<GETPIXELS></GETPIXELS>
使うのは間違いだろう
{r,g,b,a} = overlay2<<GETPIXELS></GETPIXELS>
以前は 0.0 だった場所に 0.5 を詰め込むことで、既存の値を無視します。
The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.The cut-away parts are no longer completely transparent.切り取った部分が完全に透明ではなくなりました。
[0,0] は、a をスカラーに変更するのではなく、行列の割り当てを行います。 明るい灰色の四角形は、透明な切り取りピクセルがおそらく白であることを示しており、それらを 50% の暗い灰色の前に配置すると、明るい灰色になります。
回复: 画像にテキストを追加するありがとうクレイジ! JSLの描画ウィンドウからx軸とy軸の値を直接削除し、x軸とy軸のラベルテキストをキャンセルするにはどうすればよいですか?

回复: 画像にテキストを追加するdt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
img = p1 << getpicture ;
{r,g,b,a} = img<<GETPIXELS></GETPIXELS>How can Remove white background?Thanks Experts!
Re: 画像にテキストを追加するグラフの背景色を透明にする
透明な背景を取得する 1 つの方法は、SVG を保存し、その SVG を編集して背景の四角形を削除することです。これは、Inkscape などのエディターを使用して実行することも、JSL を記述して実行することもできます。
dt = Open( "$sample_data/big class.jmp" );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", FrameBox,
// I chose fedcba to be unique, used in patmatch below
{Background Color( -Hex To Number( "fedcba" ) )}
)
)
);
gb << savepicture( "$temp/temp.svg", "svg" );
txt = Load Text File( "$temp/temp.svg" );
Write( txt ); // to log, for debugging
/* remove something like this:
<G fill="#FEDCBA">
<RECT stroke="none" x="75.5" y="33.5" width="509" height="420"></RECT>
</G>
*/
rc = Pat Match( txt, "<G fill="\!">" + Pat Arb() >> BadFillPattern + "</G>" );
If( !rc,
Throw( "fill pattern not found" )
);
// the BadFillPattern occurs twice, for two different colors. remove cases of
// <RECT stroke="none" x="75.5" y="33.5" width="509" height="420"></RECT>
// (the svg command that puts a rectangle of color behind the graph's data.)
nfound = 0;
While( Pat Match( txt, BadFillPattern, "" ), nfound += 1 );
If( nfound != 2,
Throw( "nfound=" || Char( nfound ) )
);
Save Text File( "$temp/temp.svg", txt );
// I don't know how you'll load this file on windows to prove it is transparent.
Open( "$temp/temp.svg" ); // this *does* load it, but there is nothing behind it to show through.
// you can open in FireFox and fiddle with the background color to observe the transparency
FireFox background shows through the transparency.FireFox background shows through the transparency.FireFox の背景が透明に表示されます。
SVG を透明な PNG に変換する Linux ツールがあることは知っています。おそらく、それらのツールは Win にも存在するでしょう。
編集: テストされていないアイデアが多数ありますhttps://stackoverflow.com/questions/6589358/convert-svg-to-png-in-python
Re: 画像にテキストを追加するはい、私はこのコマンドをいつも使っています
run program(executable("I:\00\imdisplay\magick.exe"),options({"C:\3\A1.png -fuzz 0% -transparent white C:\3\A2.png"}));
https://stackoverflow.com/questions/12424018/how-to-replace-white-background-color-with-transparent-of-an-image-in-imagemagic