Some artificial systems based on a deep neural network create artistic images of high perceptual quality. However, it is usually suitable for use in abstract styles. The performances of existing style transfer algorithms on anime style are not very satisfactory, because it is either not sufficiently stylized or distorted severely in comic characters' domain. In this paper, we propose a novel anime style transfer algorithm using deep neural network, which treats foreground and background differently. Moreover, our method also could transfer the style for video with a style image. We combine semantic segmentation and spatial control to transfer the specified style to the specified area. By designing the initial image and the loss function. Users could adjust the feature weights of different regions to maintain the artistic conception of the target style, and combine optical flow to ensure frame coherence in a video. Finally, some experimental results demonstrate the effectiveness of our proposed method.