Saving image quality
This commit is contained in:
parent
710b807e89
commit
540452ea39
23
README.md
23
README.md
@ -7,28 +7,25 @@ Enjoy
|
|||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
General
|
General
|
||||||
Splash screen
|
Splash screen(Complete)
|
||||||
Hide widget on mouseover
|
|
||||||
Add locks
|
|
||||||
Merge layers
|
Merge layers
|
||||||
Export multiple layers file
|
Export multiple layers file
|
||||||
% Render
|
% Render
|
||||||
balance auto=true ~ auto color
|
balance auto=true ~ auto color
|
||||||
balance 0.8 ~ equal RGB balance
|
balance 0.8 ~ equal RGB balance
|
||||||
mirror ,100 ~ mirror
|
|
||||||
Brush
|
Brush
|
||||||
Texture paint
|
Texture paint
|
||||||
|
Natural brush(Expand stroke size from stroke lenght)
|
||||||
|
Color per pointer
|
||||||
Save
|
Save
|
||||||
$ 1280x800 ~ Export with size
|
source.save 1280x800 ~ Export with size
|
||||||
Auto saveAs
|
|
||||||
History
|
|
||||||
Undo shortcut
|
|
||||||
> Terminal
|
> Terminal
|
||||||
Auto Complete
|
Auto Complete(tab)
|
||||||
Progress update
|
|
||||||
Scroll logs
|
|
||||||
Expand logs
|
|
||||||
? Interrog
|
? Interrog
|
||||||
Inline Help
|
Inline Help
|
||||||
* Eye
|
* Eye
|
||||||
Swatches, handle all colors
|
Swatches, handle all colors
|
||||||
|
- Widget
|
||||||
|
Clickeable links
|
||||||
|
- Render
|
||||||
|
Progress update
|
@ -20,15 +20,15 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
|
|||||||
#terminal logs log.input { color:white; }
|
#terminal logs log.input { color:white; }
|
||||||
#terminal logs log.image img { height:85px;width:auto;border-radius: 3px }
|
#terminal logs log.image img { height:85px;width:auto;border-radius: 3px }
|
||||||
#terminal menu { display: inline-block;position: absolute;bottom: 0px;right: 0px;padding: 0px 5px;font-size: 10px;line-height: 20px;color:white }
|
#terminal menu { display: inline-block;position: absolute;bottom: 0px;right: 0px;padding: 0px 5px;font-size: 10px;line-height: 20px;color:white }
|
||||||
|
#terminal.locked input { color:red; }
|
||||||
|
|
||||||
#terminal.hide { height:25px; }
|
#terminal.hide { height:25px; }
|
||||||
#terminal.mini { height:120px; }
|
#terminal.mini { height:120px; }
|
||||||
#terminal.full { height:100vh; }
|
#terminal.full { height:100vh; }
|
||||||
|
|
||||||
#widget { position: absolute; top:0px; left:0px; line-height: 20px; font-size:10px; z-index:9000; color:white; width:100%; height:100%; }
|
#widget { position: absolute; top:0px; left:0px; line-height: 20px; font-size:10px; z-index:9000; color:white; width:100%; height:100%; }
|
||||||
#widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; }
|
#widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; min-width:100px;}
|
||||||
#widget span name { display: block; border-bottom: 1px solid #333; line-height:25px; margin-bottom:5px;}
|
#widget span name { display: block; border-bottom: 1px solid #333; line-height:25px; margin-bottom:5px;}
|
||||||
#widget .cursor { }
|
|
||||||
#widget li { display:block; }
|
#widget li { display:block; }
|
||||||
#widget li.active { color:#72dec2; }
|
#widget li.active { color:#72dec2; }
|
||||||
#widget li.inactive { color:#fff; }
|
#widget li.inactive { color:#fff; }
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
frame.select main ;
|
frame.select background ;
|
||||||
frame.resize 400x400 ;
|
frame.resize 400x400 ;
|
||||||
brush:color #ff0000 ;
|
brush:color #ff0000 ;
|
||||||
brush.add_pointer 1,1 ;
|
brush.add_pointer 1,1 ;
|
||||||
brush.add_pointer 2,2 ;
|
brush.add_pointer 2,2 ;
|
||||||
|
layer.fill #A1A1A1 ;
|
||||||
|
render.stencil #72dec2 ;
|
||||||
|
type:size 50 ;
|
||||||
|
type.write 50,150 "RONIN" ;
|
||||||
|
type:size 15 ;
|
||||||
|
type.write 55,180 "VER 0.1 " ;
|
@ -8,7 +8,7 @@ function Filter_Stencil()
|
|||||||
var angle = cmd.angle() ? cmd.angle().degrees : 20;
|
var angle = cmd.angle() ? cmd.angle().degrees : 20;
|
||||||
var color = cmd.color() ? cmd.color().hex : "#ffffff";
|
var color = cmd.color() ? cmd.color().hex : "#ffffff";
|
||||||
|
|
||||||
ronin.render.layer.clear();
|
ronin.frame.active_layer.clear();
|
||||||
this.draw(ronin.frame.context(),angle,color);
|
this.draw(ronin.frame.context(),angle,color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,21 +130,18 @@ function Cursor(rune)
|
|||||||
|
|
||||||
this.update = function(event)
|
this.update = function(event)
|
||||||
{
|
{
|
||||||
// if(ronin.terminal.module_name){
|
if(event.altKey == true && event.shiftKey == true){
|
||||||
// this.set_mode(ronin.module);
|
this.set_mode(ronin.frame.active_layer);
|
||||||
// }
|
}
|
||||||
// else if(event.altKey == true && event.shiftKey == true){
|
else if(event.altKey == true){
|
||||||
// this.set_mode(ronin.frame.active_layer);
|
this.set_mode(ronin.default);
|
||||||
// }
|
}
|
||||||
// else if(event.altKey == true){
|
else{
|
||||||
// this.set_mode(ronin.default);
|
this.set_mode(ronin.brush);
|
||||||
// }
|
}
|
||||||
// else{
|
|
||||||
// this.set_mode(ronin.brush);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set_mode = function(mode)
|
this.set_mode = function(mode = ronin.brush)
|
||||||
{
|
{
|
||||||
if(this.mode == mode){ return; }
|
if(this.mode == mode){ return; }
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
@ -2,6 +2,8 @@ function Source(rune)
|
|||||||
{
|
{
|
||||||
Module.call(this,rune);
|
Module.call(this,rune);
|
||||||
|
|
||||||
|
this.settings = {"format":"jpg","quality":"1"};
|
||||||
|
|
||||||
this.add_method(new Method("save",["name","rect","format"]));
|
this.add_method(new Method("save",["name","rect","format"]));
|
||||||
this.add_method(new Method("load",["path","position","rect"]),"Add point");
|
this.add_method(new Method("load",["path","position","rect"]),"Add point");
|
||||||
|
|
||||||
@ -50,21 +52,24 @@ function Source(rune)
|
|||||||
|
|
||||||
ronin.terminal.query("terminal.display mini");
|
ronin.terminal.query("terminal.display mini");
|
||||||
|
|
||||||
|
if(this.settings["format"] == "jpg"){
|
||||||
|
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/jpeg',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||||
|
}
|
||||||
|
/*
|
||||||
if(params.setting("format") && params.setting("format").value == "svg"){
|
if(params.setting("format") && params.setting("format").value == "svg"){
|
||||||
ronin.terminal.log(new Log(this,ronin.path.create_svg(),"image"));
|
ronin.terminal.log(new Log(this,ronin.path.create_svg(),"image"));
|
||||||
}
|
}
|
||||||
else if(params.setting("format") && params.setting("format").value == "jpg"){
|
|
||||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
|
||||||
}
|
|
||||||
else if(params.setting("format") && params.setting("format").value == "rin"){
|
else if(params.setting("format") && params.setting("format").value == "rin"){
|
||||||
var w = window.open('about:blank','source');
|
var w = window.open('about:blank','source');
|
||||||
var html = "";
|
var html = "";
|
||||||
for (i = 0; i < ronin.terminal.history.length; i++) { html += ronin.terminal.history[i]+";<br />"; }
|
for (i = 0; i < ronin.terminal.history.length; i++) { html += ronin.terminal.history[i]+";<br />"; }
|
||||||
w.document.write("<title>Source</title><pre>"+html+"</pre>");
|
w.document.write("<title>Source</title><pre>"+html+"</pre>");
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
this.layer.remove(this);
|
this.layer.remove(this);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ function Terminal(rune)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ronin.cursor.set_mode(ronin.brush);
|
ronin.cursor.set_mode();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hint(content);
|
this.hint(content);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user