anchor.diff:      GlyphStr4   = "{|}~",                         % Codes 123 -> 126
   
       ok = egd:text(Im, get_point(), Font, GlyphStr1, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png1 = <<_/binary>> = egd:render(Im, png),
  +    File1 = filename:join(Dir,"text1.png"),
  +    ok = egd:save(Png1,File1),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File1]),
   
       ok = egd:text(Im, get_point(), Font, NumericStr, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png2 = <<_/binary>> = egd:render(Im, png),
  +    File2 = filename:join(Dir,"text2.png"),
  +    ok = egd:save(Png2,File2),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File2]),
   
       ok = egd:text(Im, get_point(), Font, GlyphStr2, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png3 = <<_/binary>> = egd:render(Im, png),
  +    File3 = filename:join(Dir,"text3.png"),
  +    ok = egd:save(Png3,File3),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File3]),
   
       ok = egd:text(Im, get_point(), Font, AlphaBigStr, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png4 = <<_/binary>> = egd:render(Im, png),
  +    File4 = filename:join(Dir,"text4.png"),
  +    ok = egd:save(Png4,File4),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File4]),
   
       ok = egd:text(Im, get_point(), Font, GlyphStr3, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png5 = <<_/binary>> = egd:render(Im, png),
  +    File5 = filename:join(Dir,"text5.png"),
  +    ok = egd:save(Png5,File5),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File5]),
   
       ok = egd:text(Im, get_point(), Font, AlphaSmStr, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png6 = <<_/binary>> = egd:render(Im, png),
  +    File6 = filename:join(Dir,"text6.png"),
  +    ok = egd:save(Png6,File6),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File6]),
   
       ok = egd:text(Im, get_point(), Font, GlyphStr4, Fgc),
  -    <<_/binary>> = egd:render(Im, png),
  +    Png7 = <<_/binary>> = egd:render(Im, png),
  +    File7 = filename:join(Dir,"text7.png"),
  +    ok = egd:save(Png7,File7),
  +    ct:log("<p>Image:</p><img src=\"~s\" />~n", [File7]),
   
       ok = egd:destroy(Im),
       erase(image_size),
  
positive.code:     Bin1 = egd_render:binary(Im1, opaque),
      Png1 = egd_png:binary(W,H,Bin1),
  
      File1 = filename:join(Dir,"fan1.png"),
      egd:save(Png1,File1),
      ct:log("<p>Image1:<img src=\"~s\" /></p>~n", [File1]),
  
      %% fan2
      Ops3 = gen_vertical_fan(7,{0,400},egd:color(red),1024,800,-15),
      Ops4 = gen_horizontal_fan(7,{512,800},egd:color(green),1024,0,-15),
  
      Im2 = lists:foldl(Fun, Im0, Ops3 ++ Ops4),
      Bin2 = egd_render:binary(Im2, opaque),
      Png2 = egd_png:binary(W,H,Bin2),
  
      File2 = filename:join(Dir,"fan2.png"),
      egd:save(Png2,File2),
      ct:log("<p>Image2:<img src=\"~s\" /></p>~n", [File2]),
      ok.
  
  gen_vertical_fan(Wd,Pt,C,X,Y,Step) when Y > 0 ->
  
negative.code:     ok = bitmap_point_has_color(Bitmap, {W,H}, Pt2, Fgc),
      ok = bitmap_point_has_color(Bitmap, {W,H}, Pt1, Fgc),
  
      Bin = <<_/binary>> = egd:render(Im, raw_bitmap, [{render_engine, alpha}]),
      Png = egd_png:binary(W,H,Bin),
      File = filename:join(Dir,"image_shape.png"),
      ok = egd:save(Png,File),
      ct:log("<p>Image:</p><img src=\"~s\" />~n", [File]),
  
      ok = egd:destroy(Im),
  
      erase(image_size),
      ok.
  
  %% Image shape API test.
  image_primitives(Config) when is_list(Config) ->
      {W,H} = get_size(proplists:get_value(max_size, Config)),
      Dir = proplists:get_value(priv_dir, Config),
      put(image_size, {W,H}),
  
      Im0 = egd_primitives:create(W, H),
  