Giter VIP home page Giter VIP logo

Comments (31)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024

Original comment by [email protected] on 24 Dec 2008 at 4:13

  • Added labels: Level-Hard

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
[deleted comment]

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
[deleted comment]

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024

Original comment by [email protected] on 26 May 2009 at 7:50

  • Added labels: Component-Pages, Milestone-2.1

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
for the layer system: I would advise to take into consideration the way artgem
handles them from a user-interface point of view as well as actions on them.

Original comment by [email protected] on 4 Jun 2009 at 10:08

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
as PulkoMandy suggested me, I'm providing more info on ArtGem layer system (as 
long
as I've succeeded in installing it under wine, if you need it just ask me, I've 
got
the 1.3 trial version).
Here you can find a screenshot of ArtGem:
http://peach.smartart.it/private/screenshots/screenshot-artgem-1.png
on top left you can find the always visible layer stack, and immediatly under it
there's the layer editing menu.
On the small layer stack you can see that there number of layers is fixed (16) 
and
you can see that a filled layer (like the first) is blue, the second layer is
activated (orange), while the third is deactivated (blue/embossed).
The editor window is quite simple: there're some functions similar to those 
present
in grafx2 palette editor: select, invert, copy and merge. Very easy.
Apart from the editor there's another small menu where you can do more or less 
the
same operations you can do with brushes: flip/flop, clear, select from alpha, 
invert
and obviously show/hide.

Some notes: obviously introducing layers means having alpha channel working, 
and more
than that having a grafx2 file format to store layer information, since gif 
don't
save it.

I think I've nothing more to add, for anything else just ask me.

Original comment by [email protected] on 13 Jun 2009 at 10:54

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Thanks for the informations :)

About tranparency, actually we have different possibilities for that :

1) use a simple "magic color" transparency, like for brushes. You select a 
transparency color for the layer and use the 255 other colors to draw on it.

2) use a real alpha channel. this will cause problems because if you use 
certain 
transparency levels with certain colors, we will not be able to display that 
properly on our 256 color screen.

3) use 2 layers with low color count and low precision alpha channel (for 
example, 
16 colors, and top layer always 50% transparent. This allows to display the 
result 
accurately, but is horrible to work with. The only use is to build pictures to 
display by flicking on old computers to get the impression there are more 
colors 
(see the climax demo on amstrad cpc for an example, or odd stuff on a plain 
atari st 
(not ste)).

I would prefer the first solution, as the idea is to have a simple way of 
keeping 
different objects on the screen, while being able to move them to rearrange the 
picture. I don't see an use for real 255 level alpha channel. If we don't want 
to 
limit the user to 255colors/layer, we will have to store the alpha channel 
separately (it could be done at 1bit per pixel but that would slow down 
calculations...)

FInally, the layers will probably be part of our animation system. The idea is 
you 
draw a layer in one frame, then you can make it move, rotate, distort or resize 
by 
inserting keyframes whith just these transformations. Or you can change the 
pixel 
data at some point.

Original comment by [email protected] on 14 Jun 2009 at 7:39

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
I think 1) and 2) are the most viable solutions.

The 1) means something slightly different than the one used for the brushes, 
instead
of removing 1 color from the palette I'd go for a out-of-bound RGB color
representation, something like (-1, -1, -1) or (999, 999, 999). Keep in mind 
that I
don't really know how code-wise the colors and image are handled, but I think 
this is
a quick and dirty solution that internally will work flawlessy.

The 2) solution is somewhat future-wise, but as well harder to implement. 
Actually an
alpha channel means an additional 256 levels opacity channel, and the color
representation will be expanded like (X,Y,Z,0) for solid colors and (X,Y,Z,255) 
for
transparent. This could be useful only if you're planning to support RGB (non
indexed) images, otherwise is futile and -as you already stated- can give you 
more
headaches when semi-transparent colors are blending when layered (or maybe not).

Actually I'd go for 1) and I am against the limiting the colors to 255 and 
reserve 1
color for transparency instead of using an OOB representation. Obviously IMHO :)

Original comment by [email protected] on 15 Jun 2009 at 8:04

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
All the images are stored in 8-bit, so we cant go out of the 0-255 range. 
That's why 
we have to use a color for transparency if we go for solution 1. If you want 
all the 
256 colors available, we have to store the alpha somewhere else, even if it's a 
boolean for each pixel.

Original comment by [email protected] on 15 Jun 2009 at 8:22

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
00.rgb.studios: The program uses 24bits for RGB palette entries, so there's no 
out-
of-bounds values. It matches what can be done in the GIF (many layers) and PNG 
format (one layer).

I agree with the 1). Just like when I draw sprites, I reserve one color entry 
for 
transparency (usually #0), and set it to a distinctive RGB value that I can 
easily 
separate from normal drawing colors.

GIF is suitable for saving/loading a layered image, however it's not a good 
display 
format since it has horrible support in IE, Firefox, and almost all the image 
viewers that I know (1.6 seconds to display a 16-kayer image, loops even if it 
shouldn't...). So even if the working format is GIF, you should "flatten" it 
for 
viewing purpose.
Maybe we can store the "resulting" image as the first frame, and try to make it 
stay 
forever...but I don't think it's well supported either.

Original comment by yrizoud on 15 Jun 2009 at 8:25

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
so my question is: what is the gif specs telling about transparent gifs? should
transparency be implemented as the 257th "color" or used a reserved color? (BTW:
isn't it in the TODO list? did I miss anything?)

about the file format (maybe we could even move on the ml to continue talking 
about
this), if you want to stick to GIF can use the animated gif format for saving 
the
layers, otherwise use PNG indexed specs (if I'm not wrong it should support 
layers,
but I think it really depends on how widespread is its implementation -as for 
GIF
layers).

Original comment by [email protected] on 15 Jun 2009 at 8:36

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
In issue 110 I listed what PNG and GIF can do. A normal transparent GIFs has 
255 
colors + transp.

PNG doesn't have layers, according to:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12311

Original comment by yrizoud on 15 Jun 2009 at 9:07

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
An idea: the number of layers doesn't matter for performance.
When drawing in the worst-case scenario, there are N layers above the drawing 
layer,
and M layers below the current. The N layers can be represented as a single 
layer of
what obstructs the view (like the current Mask mode), and we can pre-compute 
that by
merging them beforehand.
I the same way, the M layers represent what we will uncover if we fill the 
current
layer with "transparent", and this is a single solid image that we can also 
pre-compute.

Drawing only modify current layers (not above or below), so these two mergings 
only
need to be done when the user changes layers, the performance during drawing 
will not
depend on number of layers.

Original comment by yrizoud on 13 Jul 2009 at 11:29

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024

Original comment by [email protected] on 24 Jul 2009 at 3:00

  • Changed state: Started

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024

Original comment by [email protected] on 15 Sep 2009 at 7:14

  • Added labels: Milestone-2.2

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Work is in progress in the svn branch branches/layers.
For normal drawing, performances seem still good even on my old machine, but I 
know
that the drawing is about 2x more expensive in terms of cpu time (RAM 
read/write,
actually).
I'm afraid the performance drop would be fatal for people with machines even 
slower
than mine, so I'll try to keep the branches alive and separate for as long as 
possible.

Here's work in progress version, so you can test speed on your machine. (DO NOT 
USE
FOR REAL DRAWING - file saving is not tested at all) Almost all tools are 
adapted to
take layers into account already, only some specifics like the "copy to spare" 
and
palette remappings are not done.
This version has hard-coded 8 layers (even after loading an image, there are 7 
empty
layers above it). Keys are 1 to 4 and Shift-1 to Shift+4 to select and toggle 
the
layers 1 to 4, respectively. Color index Zero acts as transparent to see 
through layers.
Due to tiny bug at the moment, when program is started, the Undo/Redo system 
will not
update the screen if you've not switched main/spare at least once (TAB key).

Original comment by yrizoud on 28 Sep 2009 at 10:26

Attachments:

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Is it 1-4 on the numpad or the regular keyboard ?
In both case, it does not seem to work for me, or maybe i'm missing something...

(azerty + linux, btw, compiled from the branch)

Original comment by [email protected] on 29 Sep 2009 at 12:01

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Sorry, it's "as usual" qwerty or Windows or both.
You can edit the keys for the transparency, it's the ones I recycled: Set 
percents 10
to 80. The first four are for activating layer 1-4, the other four are for 
toggling
visibility of layer 1-4

Original comment by yrizoud on 29 Sep 2009 at 12:35

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Much-debugged version.

Original comment by yrizoud on 1 Oct 2009 at 10:49

Attachments:

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
I like the wrap of the layer when moved. The shift+1 etc hotkeys aren't changing
anything for me. 1051 release.

Original comment by [email protected] on 6 Oct 2009 at 6:07

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
To keep support for platforms that are too slow to use the layered drawing, the
solution might be to use #define sections to cleanly disable expensive 
computations.
I'll have a closer look, it seems a better solution than maintaining the two 
branches
forever.

Original comment by yrizoud on 12 Oct 2009 at 8:13

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Can't they just be disabled when there is only one layer ?

Original comment by [email protected] on 12 Oct 2009 at 8:30

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
It affects the pixel-drawing functions, and during expensive draw operations 
these
can be called many, many times per second. I don't want to add an extra 'if', 
or even
a function pointer indirection, each time. It would be slower than both 
branches.

Original comment by yrizoud on 12 Oct 2009 at 8:45

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Latest build. Fixes PNG saving, adds layer merging and re-ordering.

Original comment by yrizoud on 21 Oct 2009 at 10:15

Attachments:

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
I'm sorry for being silly, but how do I get to work with layers? :P
I DL-ed the new versions but nothing happens when I press the Layer keyboard
shortcuts from the HELP. 

Original comment by ilija.melentijevic on 26 Oct 2009 at 11:23

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
No it's my fault, I still don't find good UI to dispay feedback for user 
actions :/
Load an image or draw something, then press Alt-Insert to lay one empty layer 
over it
(it will become the active layer too) Scribble a little, then see what happens 
when
you draw with color 0.
If you use Alt-Insert more than once, you have that many layers to draw on, so 
the
shortcuts for toggling layer 1, 2, 3 etc. start working.

Here's attached a ready-made test image with 8 layers. Good to test the layer 
select
/ toggle keys.

Original comment by yrizoud on 26 Oct 2009 at 11:42

Attachments:

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
This is now finshed :)
Congratulations Yves for all the work !

Original comment by [email protected] on 15 Nov 2009 at 10:13

  • Changed state: Fixed

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Some more bugs to fix :/

Original comment by yrizoud on 15 Nov 2009 at 10:22

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Yes but it's time to open new bugreports for them I think...

Original comment by [email protected] on 15 Nov 2009 at 10:29

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Is the Layers button (that says 'layers manager') supposed to do something when 
I
click on it?
This is somewhat confusing. If it's not implemented yet, it would be nice to 
get a
dialog box telling me so rather than silently doing nothing.

Original comment by [email protected] on 16 Nov 2009 at 12:18

from grafx2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 27, 2024
Nothing plugged to this button yet. It may or may not have a menu at some point 
in
the future.
This is what you get for using WIP builds, but don't worry it will be fixed for 
the
stable release.

Original comment by [email protected] on 16 Nov 2009 at 6:59

from grafx2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.