TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

 找回密码
 新人加入
楼主: Alex
打印 上一主题 下一主题

[已解决] PixTexture color! [复制链接]

Rank: 4

6#
发表于 2013-11-4 22:41:22 |只看该作者
本帖最后由 Alex 于 2013-11-4 22:41 编辑

I have another 2 question

Why the position it's not exactly correct, there is space between letters?

---

and my second question, if the line(text) position in Aegisub is alignment 7 or 9
when i'm using this postion >>
  1.         dx = _x - int(_a / 2 + 0.5)        
  2.         dy = _y - int(_Fs / 2 + 0.5)      
复制代码
the line (text) it will be in the center of video (an8), what is the right position for alignment7 and 9?

Rank: 4

5#
发表于 2013-11-3 22:51:46 |只看该作者
本帖最后由 Alex 于 2013-11-3 22:57 编辑

Thank you very much
it's ok now



Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

地板
发表于 2013-11-3 21:28:05 |只看该作者
Alex 发表于 2013-11-3 21:20
OK

I don't know actually which function have to write first..

check it out on this documentation http://www.tcax.org/docs/tcaxLib/namespacemembers_func.html

PIX is a Python structure (object), and can be passed through Pix.... functions, http://www.tcax.org/forum.php?mod=viewthread&tid=220   (unfortunately, this doc is written in Chinese)

We have several ways to create a PIX object, such as TextPix, (create a PIX from text with specified font), BlankPix (a blank square), and pmgToPix (created a PIX from magick image object).

other functions are to manipulate the PIX object, such as PixBlur, PixTexture.


so, when applying the second approach,

PIX_out = PixTexture(PIX_out, PIX_tex2)

can be

PIX_out = PixTexture(PIX_out, PixCrop(PIX_tex2, 0, 0, PIX_out[1][0], PIX_out[1][1]))

the four parameters can be chose by your decision


Rank: 4

板凳
发表于 2013-11-3 21:20:39 |只看该作者
本帖最后由 Alex 于 2013-11-3 21:21 编辑

OK

I don't know actually which function have to write first..

this is the code
  1.     PIX_t = TextPix(Font, _txt)            
  2.    
  3.     dx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
  4.     dy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1]
  5.     dur = _KT * 10

  6.     PIX_t = PixTexture(PIX_t, PIX_tex)     
  7.     PIX_out = TextPix(FontOut, _txt)      
  8.     PIX_out = PixTexture(PIX_out, PIX_tex2)
  9.     PIX_out = PixColorMul(PIX_out, 1, 1, 1, 0)   
  10.     PIX_out = PixBlur(PIX_out, 0)           
  11.     PIX_ori = CombinePixs(PIX_out, PIX_t)   
  12.     points = PixPoints(PIX_ori)
  13.     pt_num = len(points)
复制代码
and as you said i have to use PixEnlarge(PIX,x,y) function and  PixCrop(pix, left, top, right, bottom)

pix = it will be the path on pic right?
x & y is a normal position (_x,_y) or pixs position
pixx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
pixy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1])

?

and regarding PixCrop function , pix I think is a path of pic right?!
and what should Instead of (left, top, right, bottom) write?

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

沙发
发表于 2013-11-3 19:51:37 |只看该作者
The problem is because in PixTexture() function, the size of PIX_tex will be resampled to meet the PIX_txt, so, if the size of text PIX varies, the looks of PIX_texture will be different.

how to resolve the issue,
immediately, we've got two ways
1. enlarge PIX_txt (by invoking PixEnlarge() function) to meet the size of PIX_txt
2. create a PIX_tex for each PIX_txt, according to the size of PIX_txt (using PixCrop() function to cut a piece from the original PIX_tex and make a new one, then pass it to PixTexture() function)


您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-6-30 15:51

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH